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.
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
Add duotone theme.json styles support #34667
Add duotone theme.json styles support #34667
Changes from 9 commits
bbdd7ab
5ec2efe
3c0a97e
ec86c0b
358c456
8c421cc
e9abc0b
cebab75
5956f18
c15c1cf
3c2c166
220d86d
a0134b1
537d608
23cd929
775717e
2a6a7e8
c147b04
e31fa8e
8aaa12f
c793a69
df50ef0
53b154b
008c5d5
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Would it be safe to add specificity by prepending this with
.wp-site-blocks
instead of using!important
? Can I count on having that as a container? Is it weird to usebody
instead of that class if it's not available?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 think you can rely on
.wp-site-blocks
, but i do wonder if this is a valid use of!important
- since this is a setting on an individual block, I think it should always take precedence over other CSS.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 was mention of a similar situation for elements block supports in the #core-editor Slack today.
The linked issue is #33437 and there's a fix by removing
!important
in #34689. That issue is caused by the cascade and because sometimes buttons, that we want to style differently, use the<a>
tag.The filter property doesn't cascade the same way, so we're probably fine here. But the elements block supports goes to show that just because we're setting an individual block,
!important
still might not be safe to use.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.
Is there a specific need for the duotone filters to be enqueued before the global styles?
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.
Yeah, if we can make it work without the
!important
is nice.The issue with #33437 was that
.wp-element-* a
targeted anya
element in a container (group with paragraph with link + button + social link blocks). So the issue was about how unspecific the selector was. Which makes me think: is it possible that the container with the.wp-duotone-ID
has an image with duotone and another without it? I'm just not familiar with all the blocks this can affect to. I can't think of any off the top of my head.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.
More context about where we use
!important
: we use it in the preset classes, such as.has-{value}-color
to make sure the user selection is respected despite its low specificity. More context #29533In the case of the link color, it was probably too much due to the wide reach of the selector and side-effects. We're reverting it in this case if the current PR seems solid.