CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Components: Fix Tab font size when used outside WP #71346
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
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Flaky tests detected in b659ae6. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/17231718153
|
cursor: pointer; | ||
line-height: 1.2; // Characters in some languages (e.g. Japanese) may have a native higher line-height. | ||
font-weight: 400; | ||
font-size: inherit; |
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.
Should this be $font-size-medium
instead?
cc @WordPress/gutenberg-design
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 don't mind, but just noting that for now, I used inherit to avoid any behavior change in WordPress.
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 don't mind, but just noting that for now, I used inherit to avoid any behavior change in WordPress.
My understanding is that wouldn't be a behavior change, it'd just be making explicit what we're already expecting as a style in WordPress.
(It's also what's specified in the Figma designs)
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.
"Medium" is 13px, which is almost certainly what it already inherits, and is the right thing here.
I do think there's a chance we can revisit the typography scale in the design system file, to be clear. But no concrete plans.
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.
Both inherit and medium are going to result in 13px now. The question is whether we want tabs to use the regular "app level font size" or have an explicit font size. Both can be valid, for instance writing random paragraphs and lists don't have explicit font sizes, they'll just inherit the app level one.
I changed to explicit for now though for tabs.
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.
Thanks for the fix. I also think using the Sass var instead of inherit
should be fine.
7725860
to
f4f967d
Compare
What?
One of the principles of our UI components in general is to avoid relying on global "reset" styles that might come from WordPress styles or else. This PR fixes a case in the Tab component where the font size was relying on a a reset applied to the
button
element in theforms.css
file coming from WordPress. Instead the font size is set to "inherit" to always inherit the default font size of the current application.Testing Instructions
button
element that comes from the form.css file of WordPress