Open ndiego opened 1 month ago
Thanks for the ping @ndiego 👍
I can replicate this issue. It appears to be less about specificity and more about the structure of the block and its block supports.
The block support styles and classes are applied to the block's wrapper e.g. has-font-size-*
. When the Site Title is made a link its contents are wrapped in an <a>
tag.
Global link styles by their nature target any <a>
element and so match the inner <a>
wrapping the site title block's inner text. In the absence of any other style directly targeting that link, the global style takes precedence over any inherited style.
One option might be to add some additional styles to Site Title's style.scss
file. Ones that force the inheritance of the block support styles if present. This can get a little messy and bloated though because the block probably needs styles to ensure the inheritance of all the typography.
Description
Link styles set in Global Styles override the local block styles that contain links. Good examples are the Site Title and Post Title (Title) blocks. See the video for more details.
cc @tellthemachines and @aaronrobertshaw as I know you both have been doing specificity work.
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
https://github.com/WordPress/gutenberg/assets/4832319/517e4973-30b9-4cc3-8a13-fe24f4a85491
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