Open iamtakashi opened 5 months ago
@tellthemachines if I remember correctly, you have been doing work around specificity. Mind taking a look?
@iamtakashi which theme are you testing with? I can't find that :where(ol,ul)
rule anywhere in core so assume it's coming from a theme stylesheet? Theme stylesheets are loaded after block global styles in the DOM so they will override global styles.
:where(ol,ul)
is probably defined by Twenty Twenty-Four theme. This is because the List block uses element as a selector. I was able to reproduce this issue with a customized TT4 theme.
{
...
"styles": {
"blocks": {
...
"core/archives": {
"spacing": {
"padding": {
"left": "3em"
}
}
},
...
},
...
},
...
}
The fundamental problem may be that the List block's selector affects other blocks. #56469 has been submitted to add the block class name to the List block selector.
Oh, good detective work there @t-hamano ! Yes, that's a side-effect of the specificity reduction but ultimately the best solution would be a classname for the list block.
Hi @tellthemachines @t-hamano, Thanks for looking into it.
Yes, I usually set padding to the List block like TT4 and other list type blocks accordingly, and the padding value can vary depending on the block.
It's also worth noting that Gutenberg's reset stylesheet for the iframed editor will have a non-zero specificity as well. Any stylesheet that adds styles for ul,ol
will break global styles configuration on these blocks. For example, Twenty Twenty One's padding styles reset for lists.
Description
This is likely caused by the work reducing the specificity, but now, with the Gutenberg plugin active, the default overrides the padding for the blocks that use unordered or ordered list elements.
I've noticed this issue in the following blocks, but there might be more.
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
Environment info
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes