Skip to content

Commit

Permalink
Fix: Default useRemForFontSize to false (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
nmn authored Dec 5, 2023
1 parent cf47293 commit 69883ed
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apps/docs/docs/api/configuration/babel-plugin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Prefix to applied to every generated className.
### `useRemForFontSize`

```ts
useRemForFontSize: boolean // Default: true
useRemForFontSize: boolean // Default: false
```

Should `px` values for `fontSize` be converted to `rem`?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,16 @@ function transform(source, opts = {}) {
parserOpts: {
flow: 'all',
},
plugins: [[stylexPlugin, { runtimeInjection: true, ...opts }]],
plugins: [
[
stylexPlugin,
{
runtimeInjection: true,
useRemForFontSize: true,
...opts,
},
],
],
}).code;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/babel-plugin/src/utils/state-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default class StateManager {
definedStylexCSSVariables:
(options: $FlowFixMe).definedStylexCSSVariables ?? {},
genConditionalClasses: !!(options: $FlowFixMe).genConditionalClasses,
useRemForFontSize: (options: $FlowFixMe).useRemForFontSize ?? true,
useRemForFontSize: !!(options: $FlowFixMe).useRemForFontSize,
styleResolution:
(options: $FlowFixMe).styleResolution ?? 'application-order',
unstable_moduleResolution:
Expand Down

0 comments on commit 69883ed

Please sign in to comment.