-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Unset font weight and text decoration inheritance in nav block #30011
Conversation
Size Change: +50 B (0%) Total Size: 1.4 MB
ℹ️ View Unchanged
|
// If an ancestor has a text-decoration property applied, it is inherited regardless of | ||
// the specificity of a child element. Only pulling the child out of the flow fixes it. | ||
// See also https://www.w3.org/TR/CSS21/text.html#propdef-text-decoration. | ||
float: left; |
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 for investigating! TIL.
It looks like display: inline-block;
also works, but I don't really have an opinion on whether that's any better or worse than a float.
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 for fixing this.
(fixed #30008) |
Description
If you insert an empty navigation block and set the font weight and text decoration, those bleed into the setup state:
This PR fixes that by unsetting the font weight on the button component, and writing some special CSS for the text decoration:
The thing about text decoration is that apparently text-decoration rules are inherited by all children, and cannot be overridden, even by a
text-decoration: none !important
— see https://stackoverflow.com/questions/1823341/how-do-i-get-this-css-text-decoration-override-to-workThe solution was to pull that container out of the flow using a float. Sigh.
How has this been tested?
Please test that the empty navigation block does not inherit text decoration or font weight, and that the special rule we had to add for the placeholde state, the float, doesn't have any adverse effects on adjacent blocks.
Checklist: