-
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
Try reducing specificity of global styles block selector. #57841
Closed
Closed
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
0e3ee28
Try reducing specificity of global styles block selector.
tellthemachines a3ebd94
Apply in editor
tellthemachines 9bb710a
Remove obsolete override
tellthemachines 5741fd2
zero specificity for pesky button elements
tellthemachines 3ffa0b7
Lower specificity of feature and compound selectors.
tellthemachines 0265d3a
Reduce specificity of layout selectors
tellthemachines da01237
Lower specificity of base layout styles
tellthemachines c818e92
Fix JS unit tests
aaronrobertshaw 872c324
Fix copy and paste error
aaronrobertshaw e7a7b79
Update layout support tests
aaronrobertshaw 0c049a1
Change style loading order
tellthemachines 0fee1af
Make sure global styles only load in admin
tellthemachines 20dadf2
Remove redundant filter and duplicate global styles.
tellthemachines e5e19e7
Fix style loading order better.
tellthemachines b070ef2
Reduce specificity of Cover styles
tellthemachines b3ff00f
Reinstate theme.json test updates
aaronrobertshaw 9916e9d
Reduce specificity of margin and other styles in core block theme files
tellthemachines 8ae139c
Fix invalid selector
tellthemachines 405c6f9
bump specificity of layout styles back up
tellthemachines a5c48bd
Bump up specificity of layout rule in global styles
tellthemachines 3817e5e
Fix theme json unit tests again
aaronrobertshaw 2fd08c2
Fix global styles tests
aaronrobertshaw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
There are a few other places the elements selectors might need updating as well as here if we are actually wanting to increase this selectors specificity from 0-0-1 to 0-1-1 e.g. the elements block support and the global styles output constant.
Given the spirit of this PR is to reduce specificity can we omit this change?
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 might be a bit turned around jumping between PRs, I take it this change was because at least in the theme.json class element selectors are getting wrapped in
:where
?As these selectors may be referenced elsewhere, is there a benefit to keeping the
a:where(:not(.wp-element-button))
selector for links so it is consistent with the elements block support?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'm not sure! Theoretically it would be nice if the element selectors didn't make any specificity assumptions, and we just manipulated the specificity as needed when using them in different contexts.
Relatedly, I think I found a bug in the link selector on this branch: the blocks-specific link selector no longer has the
:not
bit attached. Looking into it now!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 turns out that's only recently been fixed on trunk, so rebasing should fix it. Might not be worth it if I'm going to split this into multiple PRs though.
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.
For posterity, the PR fixing it on trunk was #59114.
Agreed, it's probably not work worrying about. On the splitting up front, I have a few other PRs based on this branch so my only question is do you see the different split parts as being pretty stable at this stage?
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 hope so, but this PR isn't getting a huge amount of feedback or testing so far, so part of my reason to split it up is hope that smaller PRs might be shippable faster. Stability is hard to predict without feedback! It works fine according to my testing, but I'm likely overlooking something 😅