-
Notifications
You must be signed in to change notification settings - Fork 360
Seedlet: Allow all blocks with a link color to override the text color value set by custom background colors #2275
Conversation
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.
@jffng my bad, I've missed one more override 🤦 |
cae0737
to
f1ecc74
Compare
Regarding the approach here, I originally tried using extra In any case, I just tested this PR briefly, but noticed that this doesn't cover all cases (as noted above, I don't think the old styles did either so I'm not sure that it's a regression). But this sample content should come in handy for testing purposes. In all of these cases, the links labeled "custom blue link" should be blue: |
@kjellr thanks for sharing the sample content! |
I went ahead and recreated all of the blocks @kjellr made. Some of my results are different. 🤔
|
Thanks for double checking @jeyip! |
f1ecc74
to
3e80f8e
Compare
It seems everything is working fine with my latest change. One quirk I've noticed when setting a text (not link) color. I'm pretty sure the idea there is to automatically adapt the text color according to the background (e.g. picking a black background will turn the text, link included, to white). This creates a little inconsistency, but I'm kinda inclined to disregard it. |
Testing
Although this PR fixes a lot of link styling, I'm not sure how I feel introducing a small regression in behavior. I'm open to the idea, but I'm curious what Kjell thinks. |
@jeyip Yeah, that's expected unfortunately. If you look at the generated |
👍 Thanks for the clarification. @Copons This might be a silly question, but could we add
|
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 the styles need to be recompiled and committed because some commented CSS is sneaking into the built styles. Other than that, this works as advertised in my testing.
Thank you!
be762a5
to
7ec9617
Compare
Good catch @jffng! I've rebased and rebuilt, and those comments disappeared. 🙂 |
Thank you @Copons @jeyip. I'm going to merge this because we want to more fully support custom link colors, and the addition of this PR covers more use cases than what we have now. Also mentally bookmarking this PR as a good example of how challenging it is right now for a theme to support an increasing number of styling combinations provided by the editor. Hopefully the amount of highly targeted CSS provided by the theme can be reduced as global styles progresses. |
Changes proposed in this Pull Request:
p
as root element (e.g. the Paragraph block).--wp--style--color--link
variable.This change originates from a discussion in Gutenberg, where we noticed that the theme's style specificity was getting in the way with the link colors on non-Paragraph blocks.
The missing fallback color was throwing a
postcss-css-variable
working when building the theme style.The
--wp--style--color--link
variable is defined by Gutenberg, and it's supported by all current browsers.For older browsers, the build system uses a fallback color.
Without providing one, the
ie.css
style showed something like this:It's not very clear by the diff because the change was mixed up with the
p
override removal, but basically I just did this: