-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Fix submenu link color when the block is nested #44409
Conversation
Size Change: +89 B (0%) Total Size: 1.26 MB
ℹ️ View Unchanged
|
Thanks for the PR. Just to understand, this is an editor-only issue? I'm having a hard time to reproduce the original issue, if I set a white color on a container, sure enough the dropdown chevron inherits it, but submenu items are still an appropriate color. In any case, it seems like an issue to potentially fix here: https://github.com/WordPress/gutenberg/blob/trunk/packages/block-library/src/navigation/style.scss#L398 — which I believe was meant to solve the same issue. Do you think that code can be tweaked to catch the edgecase at play here? |
I tested again with Twenty Twenty-Two and the submenu text is still unreadable in the header. |
Are you seeing the issue in the editor only, or also on the frontend? And sorry if this should be obvious, but do you have any steps to reproduce, or perhaps some test content? |
For the submenu block, the problem is in the editor only. The testing instructions are in the PR description. - I can not share a navigation block code because navigation blocks uses id references now, not inner blocks. For the page list submenu, there are problems both in the editor and front, but that is dealt with in a separate PR. |
I'm seeing the issue in editor and frontend, and tried an alternate fix in #44578. The color should ideally be inherited, not explicitly set, so if you set a specific menu color and background, that bleeds into the submenu. What do you think? |
What?
Adds a default black text color to submenus in the editor, and adds
color:inherit
to submenus in the editor if there is a user-set color.Closes #40908
-For page list submenus see #44310
Why?
If the navigation block was placed inside a container with a text color, submenus used that text color in the editor.
-Because the default submenu background color is white, there was a risk that the text could be white on white background. This could be seen in the header menu of Twenty Twenty-Two.
-The submenu text color option did not work in the editor.
How?
Updates the editor stylesheet for the navigation block.
Testing Instructions
Activate Twenty Twenty-Two.
Open the Site Editor and select the navigation block in the header template part.
Add a submenu to the navigation.
Confirm that the submenu background color is white, and the text color is black.
Open the color settings for the navigation block and select a submenu text color. Please test both palette colors and custom colors.
Confirm that your selected text color is working in the submenu in the editor and front.
Screenshots or screencast
Before:
After: