-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Do not provide a default value for the link color property #31755
Conversation
Size Change: +5 B (0%) Total Size: 1.32 MB
ℹ️ View Unchanged
|
Tested without problems using emptytheme (both theme.json and experimental-theme.json version 1) by adding
settings.color.link is also set to true. |
2ee5dec
to
e9a643e
Compare
I've pushed a change e9a643e so that the default value is available, just not as the default value for the property. It makes this PR essentially a revert of that change in the PR that introduced the bug. Updated the issue description. |
Ok, tested this with a variety of themes (with and without theme.json) and it's working as expected. Going to go ahead and merge it so we can release a patch version. |
Unless it's set by the theme or the user, so themes without theme.json can introduce its own fallback mechanism.
In #30541 we moved from providing a fallback to the link color such as:
to directly set the CSS Custom Property:
This is:
--wp--style--color--link
moved from being undefined unless the theme or the user set it to always being defined. While this works fine for themes with theme.json support, some themes without theme.json may use the--wp--style--color--link
in this way:It'll be used if it has a value and fallbacks to the theme color if it doesn't. This is what TwentyTwentyOne does.
What this PR does
It reverts back that change so the link color CSS Custom Property is undefined if the theme or user didn't set it. It provides the fallback value as before.
How to reproduce the bug
The expected behavior is that the link color is
#28303d
, which is the value--global--color--primary
resolves to. Instead, it is the default link color.How to test
Follow the instructions above and verify that it works as expected.
Test with a theme with theme.json and verify that link color still works (set the link color via
styles.elements.link.text
or as a user via the global styles sidebar in edit site).