-
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
Navigation block: Improve the wavy underline for dark backgrounds #68942
Comments
Hi @afercia, Thanks for highlighting this! I believe a color like Ref: https://webaim.org/resources/contrastchecker/ Sharing the screencast for the same: Screen.Recording.2025-01-30.at.9.26.23.AM.mov |
@Rishit30G I'm thinking that either we should strive to find colors that fit with any background color (which is a little challenging) or maybe consider to give up the idea of differentiating the color depending whether it's a warning (red) or info (blue). By using the text As mentioned earlier, I don't think this is an accessibility issue because the underline is an additional visual aid. The text is already meaningful and provides the necessary information e.g.: Add link, Select page, (Invalid), (Draft). Also, I'm not sure why the underline is made with a background image linear-gradient in the first place. To me, the CSS seeems unnecessarily complicated. The CSS property text-decoration can be used instead to achieve the same wavy underline. Something as simple as the following:
If preferred, the thickness of the underline can be controlled to make it non-dependant from the font, e.g. By omitting the color value Some design feedback would be appreciated @WordPress/gutenberg-design |
I agree that I also agree with simpler CSS. |
Investigating the original PR that used the blue color for the default placeholder text 'Add link' it actually used this:
Quoting from the PR:
So to my understanding there was the intent to handle dark backgrounds but I'm not sure that ever worked well because that's actually the primary color in the User profile color schemes preferences, which is a blue #007cba by default. As such I'm not sure it ever worked with dark backgrounds. |
Thanks for the screenshots. I vote for not using |
Actually, it looks like in the current implementation is a |
@hanneslsm thanks for your feedback. Not sure the link you provided works, it brings me to a 'can’t be found' page. Can you please check maybe in an incognito tab? Anyways, the current implementation doesn't use text-cedoration at all, it uses a background image linear gradient and a small bottom padding to the element the background is set to. gutenberg/packages/block-library/src/navigation-link/editor.scss Lines 83 to 110 in 055f881
I'd agree |
I just linked the image from your original issue, the one with |
It doesn't seem the case. To my understanding, when the menu item shows the placeholder text or labels, any underline provided by the theme is intentionally reset to gutenberg/packages/block-library/src/navigation-link/editor.scss Lines 77 to 78 in 4dadd50
Current trunk when setting the underline to the Navigation block > Styles > Typography > Underline: Quick test using text-decoration wavy: |
Description
Splitting this out from #68628
When an item in the navigation block misses the link, a grammar-like 'wavy underline' is shown as visual indicator for the items that needs attention. This was introduced in #32512 and then refined in #34954 which made the underline blue.
#68628 make the underline red for the 'invalid' and 'draft' cases.
However, neither the original implementation nor #68628 took into consideration themes with a background color other than white or light color, where the wavy underlines may be barely visible.
Screenshot with Twenty Twenty-Four set to the 'Maelstrom' variation. Observe the blue outline of the 'Add link' default placeholder is barely visible. Similarly, the red underline for Invalid / Draft may be barely visible with other background colors.
I haven't tested it but I guess the underlines are not visible in Windows High Contrast Mode. I don't think it's an accessibility issue though because the underline is an additional visual indicator. The missing / invalid / draft states are already communicated with the palceholder text or visible label.
The current wavy underline styling could benefit from some improvements for dark background colors though.
Cc @WordPress/gutenberg-design
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.
The text was updated successfully, but these errors were encountered: