-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Navigation block: Allow themes to override block library text-decoration rule #63406
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -76,14 +76,12 @@ $navigation-icon-size: 24px; | |
| } | ||
| } | ||
|
|
||
| &:where(:not([class*="has-text-decoration"])) { | ||
| a { | ||
| text-decoration: none; | ||
| &:where(:not([class*="has-text-decoration"])) :where(a) { | ||
| text-decoration: none; | ||
|
|
||
| &:focus, | ||
| &:active { | ||
| text-decoration: none; | ||
| } | ||
| &:focus, | ||
| &:active { | ||
|
||
| text-decoration: none; | ||
| } | ||
| } | ||
|
|
||
|
|
||
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.
Could these be combined into a single
where?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.
Another question: do we still need the
:not([class*="has-text-decoration"])if the specificity is lowered? Ideally if it has that class, it should just override this rule and the exception should no longer be needed.Uh oh!
There was an error while loading. Please reload this page.
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.
I had already tried this:
But that selector doesn't work. Is there another way?
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.
It does seem needed, it overrides a general rule for links that are not buttons which gives them underlines:

That should be a bit more obvious when testing now that I've rebased to include the fix from #63403.
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.
I've applied Aaron's suggestion now so it looks a little different - #63406 (comment)
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.
Removing the
:where(:not([class*=has-text-decoration]))won't change the specificity. So the selector would remain0-1-0specificity and continue to overridea:where(:not(.wp-element-button))which is only0-0-1.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.
Oh, I misunderstood what was meant in the original comment. I've gone ahead and removed that. 👍