Repository navigation
Elements: lower specificity of elements block css - #41931
Conversation
|
Size Change: +30 B (0%) Total Size: 1.25 MB
ℹ️ View Unchanged
|
scruffian
left a comment
There was a problem hiding this comment.
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-buttonclass, the 0.8em should be applying, keeping backward compat.Screenshots or screencast
Before:

After: