Skip to content

Conversation

@abigailalexander
Copy link
Collaborator

Previously, font sizing in cs-web-lib used the 62.5% font-size trick for font-sizing, which requires client applications to set the root font size to 62.5% for fonts to appear the correct size. This isn't very transparent and there seem to be mixed reviews on using it. It causes issues when trying to use cs-web-lib in a client application that uses e.g. MUI components alongside bob screens.

I have swapped the font back to calculating REM from pixels by using the browser default font size of 16px and added a comment for context. This won't scale correctly if a browser user manually adjusts the browser default font size, but the .bob screens don't scale correctly anyway.

following changes to the conversion factor.
Copy link
Collaborator

@rjwills28 rjwills28 left a comment

Choose a reason for hiding this comment

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

Thanks for these changes. I tested against cs-web-proto which has a test widget page and noticed a few other sizing issues so I've just fixed the default font sizes for a few additional widgets.
Hopefully we've caught everything - otherwise we'll just have to fix them when we come across them.

@abigailalexander abigailalexander merged commit 4577364 into master Feb 3, 2025
2 checks passed
@abigailalexander abigailalexander deleted the update-font-sizing branch March 18, 2025 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants