-
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
Navigation: Apply color classes to the navigation container element #50968
Conversation
@@ -524,7 +524,7 @@ function render_block_core_navigation( $attributes, $content, $block ) { | |||
|
|||
if ( $is_list_item && ! $is_list_open ) { | |||
$is_list_open = true; | |||
$inner_blocks_html .= '<ul class="wp-block-navigation__container">'; | |||
$inner_blocks_html .= '<ul class="wp-block-navigation__container '.implode( ' ', $classes ).'">'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will only work for preset colors, not custom ones, sadly
Flaky tests detected in 299b146. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5081878086
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is looking good to me, I couldn't get it to break :D
Co-authored-by: Maggie <3593343+MaggieCabrera@users.noreply.github.com>
What?
Makes the navigation submenu blocks inherit their color from the navigation block. Fixes #50235
Why?
On trunk when a navigation block sets a background color the submenus lose their color which cases issues like #50235.
How?
We just needed to add the right classes to the container block.
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast
Props to @MaggieCabrera who found the issue.