Skip to content
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

Setting text color on group block overrides link color #61242

Open
gabbsmo opened this issue Apr 30, 2024 · 10 comments
Open

Setting text color on group block overrides link color #61242

gabbsmo opened this issue Apr 30, 2024 · 10 comments
Labels
[Block] Group Affects the Group Block [Type] Bug An existing feature does not function as intended

Comments

@gabbsmo
Copy link

gabbsmo commented Apr 30, 2024

Description

Not sure exactly when but in later releases of WordPress, such has 6.4 an onwards all links in group blocks where I set a text color, got the same color as the text, instead of the link color in my theme.

Step-by-step reproduction instructions

  1. Configure theme to have for example pink link color
  2. Create a group block
  3. Add a paragraph including text and a link
  4. Set group background to black
  5. Set group text to white
  6. Notice the link is also white

Screenshots, screen recording, code snippet

This is the theme style for links:

a:visited {
    color: #ec008c;
}

a {
    color: #ec008c;
}

This is the offending style from Gutenberg that takes predecense:

.wp-elements-557f8b797744562d55077c4373778302 a:where(:not(.wp-element-button)) {
    color: var(--wp--preset--color--text-bright);
}

Environment info

WordPress: 6.5.2
Theme: Generatepress 3.4.0

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@gabbsmo gabbsmo added the [Type] Bug An existing feature does not function as intended label Apr 30, 2024
@gabbsmo
Copy link
Author

gabbsmo commented Apr 30, 2024

For some odd reason the group block have color customization for a lot of things, but not links. Would be nice if it was there. With that said, I think this is a regression that breaks the style of existing websites.

@richtabor
Copy link
Member

This is intentional actually. Otherwise, you have to explicitly change the link color as well, in any instance where you are required to change the text color as well, when the background color applied does not contrast appropriately to the default paragraph color.

For some odd reason the group block have color customization for a lot of things, but not links.

Do you not see the Link color control here on the right?

CleanShot 2024-04-30 at 10 23 42

@gabbsmo
Copy link
Author

gabbsmo commented Apr 30, 2024

No, only have text and body.

@richtabor
Copy link
Member

When you add a a Text color, Link should also render there. Also, using the "More" menu:

CleanShot 2024-04-30 at 11 50 53

@gabbsmo
Copy link
Author

gabbsmo commented May 2, 2024

It seems that the Link color menu option is only visible in newer themes. I can see it in Twenty Twenty Four and Twenty Twenty Two, but not Twenty Twenty for example. Plugins have no bearing on this, in my case at least.

Also not available in GeneratePress (or my child theme of it) but that is of course a third party theme.

I understand this change was "by design" but perhaps it should not have been applied to legacy themes, as it breaks existing styles.

@richtabor
Copy link
Member

It's not breaking styles, correct? If you apply a text color — it will override the link color. Existing colors applied to existing elements do not get modified, unless you modified them after updating to the version of WordPress that included this.

I'll look into why GeneratePress does not support link styling; it should available for every theme.

@gabbsmo
Copy link
Author

gabbsmo commented May 2, 2024

I'll look into why GeneratePress does not support link styling; it should available for every theme.

Thanks! It is also not available in Twenty Twenty.

@jordesign jordesign added the [Block] Group Affects the Group Block label May 5, 2024
@cbirdsong
Copy link

Is has-link-color always accompanyinghas-text-color new in 6.5? I don’t recall seeing it before.

@gabbsmo
Copy link
Author

gabbsmo commented May 19, 2024

In Twenty Twenty Four the block settings have two tabs: Settings and Styles. The styles tab do have the "Links" option under color. This is not in the case in Twenty Twenty or GeneratePress.
image

@gabbsmo
Copy link
Author

gabbsmo commented May 20, 2024

It also seems that the themes that do not have link color option in the editor do not have a theme.json file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Group Affects the Group Block [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

4 participants