[release-1.9] fix(theme): pick the navigation or rhdh colors based on user's config#2875
Conversation
Signed-off-by: Karthik <karthik.jk11@gmail.com>
Code Review by Qodo
1. Unreadable submenu defaults
|
|
Review Summary by Qodo
WalkthroughsDescription• Add pageInsetBackgroundColor token to control page inset background independently • Implement intelligent color resolution between palette.navigation and rhdh.general configs • Update sidebar styling to use resolved navigation colors for items and submenu states • Fix sidebar background color application to page inset only, not main content Diagramflowchart LR
A["User Theme Config"] -->|navigation or rhdh.general| B["resolveNavigationSidebarColors"]
B -->|sidebarBackgroundColor| C["BackstageSidebar & MuiDrawer"]
B -->|sidebarItemInteractionBackgroundColor| D["BackstageSidebarItem & MuiBottomNavigationAction"]
B -->|navigationItemColor & navigationSelectedColor| E["Selected/Hover States"]
F["pageInsetBackgroundColor token"] -->|defaults to appBarBackgroundColor| G["BackstageSidebarPage root"]
C --> H["Styled Navigation Sidebar"]
D --> H
E --> H
G --> H
File Changes1. workspaces/theme/plugins/theme/src/types.ts
|



Release-1.9 PR
This is a cherry-pick of 482ba12
https://redhat.atlassian.net/browse/RHDHBUGS-2981
The PR containss following chagns:
Align the navigation sidebar with merged palette.navigation and rhdh.general colors, including submenu rows and selected/active BackstageSidebarItem states.
Removes a theme override that set sidebarBackgroundColor in a way that applied the sidebar background color to main page inset.
Introduce a new token pageInsetBackgroundColor, so the page inset background can be controlled by config (defaults to appBarBackgroundColor).
Default RHDH without any customizations:
Customized sidebar background color states:
✔️ Checklist