-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Components: Normalize font-family #38969
Conversation
Size Change: +112 B (0%) Total Size: 1.15 MB
ℹ️ View Unchanged
|
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.
Apart from a teeny-tiny nit, changes LGTM and test as per instructions 🚀
It feels great to see all the little incremental improvements!
@@ -237,6 +237,10 @@ | |||
} | |||
} | |||
|
|||
.components-datetime__time-field-integer-field { |
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.
Tiny nit: looks like this class is also applied to the Months dropdown in the date time picker, so maybe we should rename it to a name that doesn't refer to "integer" ?
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.
Good catch, I didn't even notice! I considered renaming it to "form", but looking at the code again, the "integer" in the internal component <UpdateOnBlurAsIntegerField>
seems to be about handling integer validation concerns. So the fact that the Months dropdown is using it looks like an abstraction failure, rather than just inappropriate naming 😬 I think we should keep this as is for now, until it causes issues.
b5b74f9
to
d69e495
Compare
Fixes #37555
Description
This fixes a
font-family
inconsistency that causes some environments to render certain control elements in an unintended font.Directly affected components
Anything relying on these components will be fixed as well.
Background
Chrome has user agent styles that make
input
,select
, andbutton
default to Arial (not sure if this is the same font for everyone). This basically makes these control elements render in a different font from the surrounding UI.This problem doesn't manifest in contexts where the core WP
forms.css
is loaded (i.e. wp-admin), since that includes these normalizing rules:The presence of
forms.css
is obviously not guaranteed, as has surfaced in Storybook.I briefly considered adding some kind of global reset styles for the wp-components package, but I think we should be adding them explicitly in each relevant component because ultimately we're aiming for complete tree-shakeable encapsulation. Thoughts?
Testing Instructions
npm run storybook:dev
Screenshots
CleanShot.2022-02-22.at.05.13.24.mp4
Types of changes
Bug fix
Checklist:
*.native.js
files for terms that need renaming or removal).