Skip to content

fix: remove fontScale from CSS relative units to prevent double scaling#447

Open
axyz wants to merge 1 commit intofacebook:mainfrom
axyz:fix/double-font-scaling
Open

fix: remove fontScale from CSS relative units to prevent double scaling#447
axyz wants to merge 1 commit intofacebook:mainfrom
axyz:fix/double-font-scaling

Conversation

@axyz
Copy link

@axyz axyz commented Jan 28, 2026

By default react-native textual elements have the allowFontScaling prop set to true, effectively making px values to behave like rem/em values. The existing polyfill, though, scales the px values using the detected fontScale. This leads to a double amount of scaling on the native app.

This PR remove the fontScale multiplier, leaving the scaling to the native capability, while keeping the polyfill logic to translate em/rem to appropriate px values.

@axyz axyz requested a review from necolas as a code owner January 28, 2026 13:25
@meta-cla meta-cla bot added the cla signed label Jan 28, 2026
"height": -100,
"position": "static",
"width": NaN,
"width": 100,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems that removing the fontScale accidentally fixed this preexisting bug where the resolved value was NAN, I'm assuming it could have been a lack of mocking in the test though?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant