@@ -22,6 +22,7 @@ import { type CSSObject } from '@mui/material/styles';
2222
2323import { ThemeConfig , ThemeConfigOptions , RHDHThemePalette } from '../types' ;
2424import { redHatFontFaces , redHatFonts } from '../fonts' ;
25+ import { resolveNavigationSidebarColors } from './navigationSidebarColors' ;
2526
2627export type Component = {
2728 defaultProps ?: unknown ;
@@ -617,16 +618,33 @@ export const createComponents = (themeConfig: ThemeConfig): Components => {
617618 }
618619
619620 if ( options . sidebars !== 'mui' ) {
621+ const {
622+ sidebarBackgroundColor,
623+ sidebarItemInteractionBackgroundColor,
624+ navigationItemColor,
625+ navigationSelectedColor,
626+ } = resolveNavigationSidebarColors ( themeConfig ) ;
627+
620628 components . BackstageSidebar = {
621629 styleOverrides : {
622630 drawer : {
623631 gap : '0.25rem' ,
624- borderRight : `0.5rem solid ${ general . sidebarBackgroundColor } ` ,
632+ borderRight : `0.5rem solid ${ sidebarBackgroundColor } ` ,
625633 paddingBottom : '1.5rem' ,
626- backgroundColor : general . sidebarBackgroundColor ,
634+ backgroundColor : sidebarBackgroundColor ,
627635 '& hr' : {
628636 backgroundColor : general . sidebarDividerColor ,
629637 } ,
638+ '& [class*="BackstageSidebarItem-selected-"][class*="BackstageSidebarItem-root-"]' :
639+ {
640+ backgroundColor : `${ sidebarItemInteractionBackgroundColor } !important` ,
641+ color : `${ navigationSelectedColor } !important` ,
642+ } ,
643+
644+ '& [class*="BackstageSidebarSubmenuItem-selected-"]' : {
645+ background : `${ sidebarItemInteractionBackgroundColor } !important` ,
646+ color : `${ navigationSelectedColor } !important` ,
647+ } ,
630648 } ,
631649 } ,
632650 } ;
@@ -638,7 +656,7 @@ export const createComponents = (themeConfig: ThemeConfig): Components => {
638656 marginLeft : '0.5rem !important' ,
639657 textDecorationLine : 'none' ,
640658 '&:hover, &:focus-visible' : {
641- backgroundColor : general . sidebarItemSelectedBackgroundColor ,
659+ backgroundColor : sidebarItemInteractionBackgroundColor ,
642660 } ,
643661 } ,
644662 label : {
@@ -647,15 +665,16 @@ export const createComponents = (themeConfig: ThemeConfig): Components => {
647665 } ,
648666 } ,
649667 selected : {
650- backgroundColor : general . sidebarItemSelectedBackgroundColor ,
668+ backgroundColor : sidebarItemInteractionBackgroundColor ,
669+ color : navigationSelectedColor ,
651670 } ,
652671 } ,
653672 } ;
654673 components . MuiBottomNavigation = {
655674 styleOverrides : {
656675 root : {
657- backgroundColor : `${ general . sidebarBackgroundColor } !important` ,
658- borderColor : `${ general . sidebarBackgroundColor } !important` ,
676+ backgroundColor : `${ sidebarBackgroundColor } !important` ,
677+ borderColor : `${ sidebarBackgroundColor } !important` ,
659678 } ,
660679 } ,
661680 } ;
@@ -665,19 +684,19 @@ export const createComponents = (themeConfig: ThemeConfig): Components => {
665684 } ,
666685 styleOverrides : {
667686 root : {
668- color : `${ palette . text ?. primary } !important` ,
669- backgroundColor : `${ general . sidebarBackgroundColor } !important` ,
687+ color : `${ navigationItemColor } !important` ,
688+ backgroundColor : `${ sidebarBackgroundColor } !important` ,
670689 borderRadius : '6px' ,
671690 borderTop : '3px solid transparent !important' , // default mui selected styling
672691 paddingTop : '6px !important' , // default mui selected styling
673692 marginTop : '-1px !important' , // default mui selected styling
674693 '&:hover, &:focus-visible' : {
675- backgroundColor : `${ general . sidebarItemSelectedBackgroundColor } !important` ,
694+ backgroundColor : `${ sidebarItemInteractionBackgroundColor } !important` ,
676695 } ,
677696 } ,
678697 selected : {
679- backgroundColor : `${ general . sidebarItemSelectedBackgroundColor } !important` ,
680- color : `${ palette . text ?. primary } !important` ,
698+ backgroundColor : `${ sidebarItemInteractionBackgroundColor } !important` ,
699+ color : `${ navigationSelectedColor } !important` ,
681700 } ,
682701 } ,
683702 } ;
@@ -686,7 +705,7 @@ export const createComponents = (themeConfig: ThemeConfig): Components => {
686705 root : {
687706 // undocumented Backstage makeStyles
688707 "& [class*='makeStyles-overlay-']" : {
689- backgroundColor : `${ general . sidebarBackgroundColor } !important` ,
708+ backgroundColor : `${ sidebarBackgroundColor } !important` ,
690709 } ,
691710 '& hr' : {
692711 backgroundColor : general . sidebarDividerColor ,
@@ -729,7 +748,8 @@ export const createComponents = (themeConfig: ThemeConfig): Components => {
729748 root : {
730749 // Controls the page inset as in PF6 -- only in desktop view
731750 '@media (min-width: 600px)' : {
732- backgroundColor : general . sidebarBackgroundColor ,
751+ backgroundColor :
752+ general . pageInsetBackgroundColor ?? general . appBarBackgroundColor ,
733753 // Prevents the main content from scrolling weird
734754 overflowY : 'auto' ,
735755 // Cancel out the spacing produced by the page inset border when
0 commit comments