Fix sub-menu background color inheritance from nav-menu block settings #262
Merged
RachelRVasquez merged 2 commits intoApr 16, 2026
Conversation
…u via the Nav Menu block
…block itself for its bg color to the member info block. Fix in header-02 pattern for this compat.
RachelRVasquez
approved these changes
Apr 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
All Submissions:
Changes proposed in this Pull Request:
When a background color is assigned to the memberlite/nav-menu block in the editor, it was only applied to the
element. The dropdown .sub-menu flyouts kept the theme's default nav background instead.outer
This PR bridges the gap using a CSS custom property (--memberlite-color-navigation-block-background), which does
inherit through the cascade including to absolutely-positioned descendants.
--memberlite-color-navigation-block-backgroundviaget_block_wrapper_attributes()..sub-menubackground-color now usesvar(--memberlite-color-navigation-block-background, var(--memberlite-color-site-navigation-background)), falling back to the theme default when no block color isset
How to test the changes in this Pull Request:
Observe on the frontend that the bg color cascades to the sub menu.
You can also NOT set any custom bg color and instead, change the Customizer > Colors setting for Primary Navigation bg. Without colors set on the nav menu block directly, the sub-menu should inherit that theme-wide color setting.
Other information: