-
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
Paragraph Block with darker background color and text in lighter color not working for links. #4711
Comments
Good catch! I would put as a bug but this is a case of the theme causing that to be an issue. I wonder though what we can do Gutenberg side to ease this. I'm cautious to add 'yet another' colour to the list for links. But, could we be a little smarter here? What about a warning and/or changing the contrast of the link to show up? |
"the Theme is causing that issue", is not entirely accurate from where I sit. Backing up a bit: Gutenberg starts out with giving users the capabilities to override a Theme's default color scheme. I embrace it, I love it. But I see it more from a "You break it, you buy it" kind of way. From the moment Gutenberg allows users to take over, it needs to provide some guard-rails and help from the editor. A brilliant example is the contrast warning, with light blue text on dark blue background. And an essential part is that the user can act on this warning and fix it easily right there. If you go that route with the link color as well, the user won't have the tools to fix it. What do you want her to do? Call the Theme developer? Fiddle with the css editor? The best way would be to add link color settings, as it would make this feature complete. That's all. I can change, background color, text color, link color. This will come up more often than not, and you will have the conversation again and again. :-) At least with me BTW: I do think it's a bug. hehe |
I agree this is an issue. If you have a text block with a background color and an updated text color, I'm expecting all the text to be that color — including my links. I think we have two potential solutions:
My vote is personally for 1. |
+1 like the choice number 1. Thanks @melchoyce for chiming in:-) |
That first option definitely works for Themes with underlined/bolded links, but Themes with ➕ for disliking the idea of cluttering the UI with Partially-formed idea🤔 There is this nifty function in Color.js that will find the maximum contrast color for a provided color. One possible flow...
Ex. User picks dark blue background, Definitely a little heavy-handed/perhaps entering plugin territory... Hard to know a Theme's link styles programmatically, and probably wouldn't want to do this on sites with underline/bold styles... so it'd be all-or-nothing unless a Setting was added to toggle (blegh). Auto link coloring might be overkill... can't entirely prevent bad design decisions. But there may be some merit to auto-toggling the |
Might be worth doing some explorations here to see how it looks. But I also think we could also just force the display of underline on links under certain background color combinations (probably after a certain luminosity). So if the bg color is at a point where text has to be lighter than bg, we can make links match the paragraph color and show an underline. |
Following 'decisions, no options' and 'out of the box' - adopting the selected text color also for the links in the paragraph and underlining links by default would be a perfectly acceptable solution for me. Anything else could be handled via custom blocks. |
Whilst I totally understand having an option I do like the idea of this being automatic. I'd say let's explore that over having explicit color picking. For now, removing the design feedback label as would like to get that explored and wouldn't need design. |
Seems this will be fixed in 4.0 #10171 by @jorgefilipecosta |
Hi, all thank you for the discussion! I'm closing this issue for now as it should be fixed by #10171. |
Issue Overview
I love the feature to change the background color of a paragraph block. I also appreciate the warning for the text color when the contrast ratio is not big enough. Unfortunately, that's not working so well if the paragraph contains a link
Steps to Reproduce (for bugs)
1.Create a paragraph block with dummy text and link a portion to a different page on the site or an outside website.
2. open the block setting and change the background color to middle blue and change the text color to white or light gray.
Expected Behavior
I would expect the link color to change as well, if just for slightly different color.
Current Behavior
Possible Solution
Add a link color changer to the settings.
Screenshots / Video
A recording: http://recordit.co/cK3HPAxbQS
Related Issues and PRs
Todos
The text was updated successfully, but these errors were encountered: