-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use UnitControl for font-size #31314
Conversation
Size Change: +176 B (0%) Total Size: 1.31 MB
ℹ️ View Unchanged
|
@carolinan tbh I don't know... Whatever the plan however, font-sizes should not, under any circumstances, be limited to |
This comment has been minimized.
This comment has been minimized.
The G2 version of the font size picker is gone for now, to be later re-implemented once its dependencies are migrated. When it's re-implemented we can make sure that it uses UnitControl 👍 That way we don't introduce a regression. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ddd2b50
to
7c27cac
Compare
All tests now pass 🎉 |
onChange( nextSize ); | ||
} | ||
} } | ||
units={ CSS_UNITS } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think themes can control the available units or disable them, is this being taken into consideration here?
This is cool. One thing I'm using on my own site, which isn't quite launched yet, is It might be fun to explore some clamp usage in the future to have some intrinsic responsiveness, but that's a thought for another day. |
I do the same... but I do it for all elements of a page. So the |
Just to follow up, I explored query-less responsiveness a bit more in this codepen. I also leveraged some of that for my theme. |
Description
This PR allows using non-px values for font-sizes, by using
UnitControl
instead of the custom number input we were previously using.Font-sizes were previously saved using
px
as a hardcoded unit, so there are no backwards-compatibility issues I could find. This just allows usingem
/rem
units.How has this been tested?
Tested in new blocks, tested in existing posts, nothing breaks. Tested using px, em & rem values. nothing breaks.
Screenshots
Before:
After:
Types of changes
Checklist:
*.native.js
files for terms that need renaming or removal).