-
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
Reduce specificity of legacy font sizes defined by core #37819
Conversation
@Mamaduka @noisysocks I've milestoned this one for 5.9, in case you think there's still leeway to include it. |
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.
LGTM and makes perfect sense 👍
Size Change: -16 B (0%) Total Size: 1.13 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.
Thanks for working on this, @oandregal.
Changes make sense to me as well. I'm going to add Backport label.
Thanks for staying on this. This seems like a good step forward, and it's always nice to see specificity lowered. |
Related #37617
There's an issue by which legacy font sizes (normal & huge) provided by core override the theme classes in WordPress 5.9 (or using the Gutenberg plugin).
Why it happens
.has-<slug>-font-size { font-size: value; }
.has-<slug>-font-size { font-size: var(--wp--preset--font-size-<slug>) !important; }
normal
andhuge
at Font sizes: update default values #37381 Because we still need to make them available for old content, those classes were moved back to the old bundle. However, they still have an!important
that makes it difficult for others to override, which doesn't make sense for a legacy default.The fix
For the two legacy font sizes (
normal
andhuge
) we should reduce the specificity back to what it was:.has-<slug>-font-size { font-size: value; }
.How to test
The expected result is that the paragraph font size is the one defined by the theme,
21px
. If using the plugin from thetrunk
branch, what happens is that the font size is16px
instead.