Repository navigation
Do not provide a default value for the link color property - #31755
Merged
Merged
Conversation
|
Size Change: +5 B (0%) Total Size: 1.32 MB
ℹ️ View Unchanged
|
Member
Contributor
|
Tested without problems using emptytheme (both theme.json and experimental-theme.json version 1) by adding settings.color.link is also set to true. |
oandregal
force-pushed
the
fix/link-color-no-default
branch
from
May 13, 2021 12:06
2ee5dec to
e9a643e
Compare
Member
Author
|
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. |
Member
Author
|
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. |
youknowriad
pushed a commit
that referenced
this pull request
May 17, 2021
Unless it's set by the theme or the user, so themes without theme.json can introduce its own fallback mechanism.
75 of 82 tasks
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.


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--linkmoved 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--linkin 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--primaryresolves 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.textor as a user via the global styles sidebar in edit site).