-
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
Try: Remove color inheritance specificity. #35725
Conversation
Size Change: +98 B (0%) Total Size: 1.07 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 so much for the green light. I'm tempted to land this because it's such a small change. However it's at a sensitive place in the code, so I'd love to just boost the confidence level even more with a few more reviews, if people have time. Thanks! |
Thanks a lot, @jasmussen! I'm seeing the following with TT1 Blocks. This obviously seems fine for the Site Title; I am however not entirely sure about the navigation links. Are they supposed to respect the text color, i.e. should they be red (as the 3rd screenshot in the PR description seems to indicate)? |
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.
See my comments -- seems like we need to tweak this a bit more 😅
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.
Thanks Joen, this seems to be working well now! Tested with TT1 Blocks (with submenu, also testing the mobile overlay menu), Empty Theme, TT1, Twenty Twenty, Twenty Nineteen.
Sweet, thank you, and thanks everyone. I'm going to test this one a bit more tomorrow, then land it. |
I tested a rebased version of this with TT1 blocks again, empty theme, and Blockbase, and things still appear to work. So I'm going to land this one as is, but I would appreciate those of you receiving this message to help keep an eye out for any text-color/global styles related navigation block issues that might have resulted from this. |
Description
Probably fixes #34648.
#31878 heavily refactored the navigation block CSS to reduce specificity of many selectors, so as to allow global styles to override colors. One part of that was also to override inherited colors. I don't recall the specifics, but this was necessary at the time to fix an issue with colors otherwise not inheriting at all. As a result, if you insert a Site Title block inside navigation, and customize its link color, that doesn't work:
That extra specificity doesn't appear to be necessary anymore. And in removing it, things appear to work as they should:
Because the rule was necessary at the time, but doesn't appear to be necessary anymore, it would be good to test this one well.
How has this been tested?
Here's some test content:
Please test in a few themes, including Empty Theme and some block themes. In combination with having a site title with a customized link color, please test most of the navigation properties and features, including all the color options, most notably submenus and the mobile responsive overlay menu, and verify that the colors defined on the navigation block apply all the way down the hierarchy, unless overridden by an individual block.
Checklist:
*.native.js
files for terms that need renaming or removal).