File, Search Blocks: Lower CSS specificity #41393
Conversation
|
Size Change: -701 B (0%) Total Size: 1.24 MB
ℹ️ View Unchanged
|
mikachan
left a comment
There was a problem hiding this comment.
This works for me when using emptytheme and those theme.json settings 👍 I think the use of :where works well here too.
There was a problem hiding this comment.
🧇 great! @MaggieCabrera can we add a comment for
* + .wp-block-file__button and :where(.wp-block-search__button-inside .wp-block-search__inside-wrapper) explaining how we want to lower specificity and for what reason? Given someone may come back to this months later it's easy to no understand what's up with this solution.
Similar to how we do here in the paragraph block.
|
I´m not changing |
|
Could the Search block's wrapper have a higher specificity? As noted on Trac 60164, the old CSS reset removed border and padding on any Using two elements could be enough: |
What?
Lowers the CSS specificity for the File and Search Block selectors
Why?
The high specificity of these selectors are overriding the newest addition to the elements API (the buttons), pointed out here and here.
How?
I'm trying to remove unneeded selectors and used :where when I wasn't sure about what I could remove without breaking other stuff
Testing Instructions
I've tested this using emptytheme, with the following markup:
And in the theme.json file I have this:
Screenshots or screencast
With the theme.json changes:
Without the theme.json changes:
/cc @WordPress/block-themers