-
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
Elements: lower specificity of elements block css #41931
Conversation
Size Change: +30 B (0%) Total Size: 1.25 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.
LGTM. Thanks for fixing
How would you feel about removing this hardcoded font size? |
@carolinan may it be a good separate issue with a Needs Design Feedback label? |
I'd love to remove it. My main concern is that it will change the appearance of user's sites without them knowing. The nice thing about this approach is that if users add new file blocks they will use the standard size, so I don't think there is a need to override it in Global Styles for the file block. |
What?
This PR fixes an issue with the default font size defined for the file block not being overridden by theme.json button element rules.
Why?
After #41822 got merged, the block.json defaults where generating a CSS that was more specific than the one generated by a themes theme.json file for the same element, so it was always being applied.
How?
I removed the default font size definition and moved it to the CSS, and made it only apply to non element file buttons.
Testing Instructions
On a block theme add this to theme.json:
Insert a file block and check the font size of the button. Without this PR it's always 0.8em, with this PR it should apply what's on theme.json.
If the block doesn't have the
.wp-element-button
class, the 0.8em should be applying, keeping backward compat.Screenshots or screencast
Before:
After: