@@ -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 ;
@@ -616,16 +617,33 @@ export const createComponents = (themeConfig: ThemeConfig): Components => {
616617 }
617618
618619 if ( options . sidebars !== 'mui' ) {
620+ const {
621+ sidebarBackgroundColor,
622+ sidebarItemInteractionBackgroundColor,
623+ navigationItemColor,
624+ navigationSelectedColor,
625+ } = resolveNavigationSidebarColors ( themeConfig ) ;
626+
619627 components . BackstageSidebar = {
620628 styleOverrides : {
621629 drawer : {
622630 gap : '0.25rem' ,
623- borderRight : `0.5rem solid ${ general . sidebarBackgroundColor } ` ,
631+ borderRight : `0.5rem solid ${ sidebarBackgroundColor } ` ,
624632 paddingBottom : '1.5rem' ,
625- backgroundColor : general . sidebarBackgroundColor ,
633+ backgroundColor : sidebarBackgroundColor ,
626634 '& hr' : {
627635 backgroundColor : general . sidebarDividerColor ,
628636 } ,
637+ '& [class*="BackstageSidebarItem-selected-"][class*="BackstageSidebarItem-root-"]' :
638+ {
639+ backgroundColor : `${ sidebarItemInteractionBackgroundColor } !important` ,
640+ color : `${ navigationSelectedColor } !important` ,
641+ } ,
642+
643+ '& [class*="BackstageSidebarSubmenuItem-selected-"]' : {
644+ background : `${ sidebarItemInteractionBackgroundColor } !important` ,
645+ color : `${ navigationSelectedColor } !important` ,
646+ } ,
629647 } ,
630648 } ,
631649 } ;
@@ -637,7 +655,7 @@ export const createComponents = (themeConfig: ThemeConfig): Components => {
637655 marginLeft : '0.5rem !important' ,
638656 textDecorationLine : 'none' ,
639657 '&:hover, &:focus-visible' : {
640- backgroundColor : general . sidebarItemSelectedBackgroundColor ,
658+ backgroundColor : sidebarItemInteractionBackgroundColor ,
641659 } ,
642660 } ,
643661 label : {
@@ -646,15 +664,16 @@ export const createComponents = (themeConfig: ThemeConfig): Components => {
646664 } ,
647665 } ,
648666 selected : {
649- backgroundColor : general . sidebarItemSelectedBackgroundColor ,
667+ backgroundColor : sidebarItemInteractionBackgroundColor ,
668+ color : navigationSelectedColor ,
650669 } ,
651670 } ,
652671 } ;
653672 components . MuiBottomNavigation = {
654673 styleOverrides : {
655674 root : {
656- backgroundColor : `${ general . sidebarBackgroundColor } !important` ,
657- borderColor : `${ general . sidebarBackgroundColor } !important` ,
675+ backgroundColor : `${ sidebarBackgroundColor } !important` ,
676+ borderColor : `${ sidebarBackgroundColor } !important` ,
658677 } ,
659678 } ,
660679 } ;
@@ -664,19 +683,19 @@ export const createComponents = (themeConfig: ThemeConfig): Components => {
664683 } ,
665684 styleOverrides : {
666685 root : {
667- color : `${ palette . text ?. primary } !important` ,
668- backgroundColor : `${ general . sidebarBackgroundColor } !important` ,
686+ color : `${ navigationItemColor } !important` ,
687+ backgroundColor : `${ sidebarBackgroundColor } !important` ,
669688 borderRadius : '6px' ,
670689 borderTop : '3px solid transparent !important' , // default mui selected styling
671690 paddingTop : '6px !important' , // default mui selected styling
672691 marginTop : '-1px !important' , // default mui selected styling
673692 '&:hover, &:focus-visible' : {
674- backgroundColor : `${ general . sidebarItemSelectedBackgroundColor } !important` ,
693+ backgroundColor : `${ sidebarItemInteractionBackgroundColor } !important` ,
675694 } ,
676695 } ,
677696 selected : {
678- backgroundColor : `${ general . sidebarItemSelectedBackgroundColor } !important` ,
679- color : `${ palette . text ?. primary } !important` ,
697+ backgroundColor : `${ sidebarItemInteractionBackgroundColor } !important` ,
698+ color : `${ navigationSelectedColor } !important` ,
680699 } ,
681700 } ,
682701 } ;
@@ -685,7 +704,7 @@ export const createComponents = (themeConfig: ThemeConfig): Components => {
685704 root : {
686705 // undocumented Backstage makeStyles
687706 "& [class*='makeStyles-overlay-']" : {
688- backgroundColor : `${ general . sidebarBackgroundColor } !important` ,
707+ backgroundColor : `${ sidebarBackgroundColor } !important` ,
689708 } ,
690709 '& hr' : {
691710 backgroundColor : general . sidebarDividerColor ,
@@ -728,7 +747,8 @@ export const createComponents = (themeConfig: ThemeConfig): Components => {
728747 root : {
729748 // Controls the page inset as in PF6 -- only in desktop view
730749 '@media (min-width: 600px)' : {
731- backgroundColor : general . sidebarBackgroundColor ,
750+ backgroundColor :
751+ general . pageInsetBackgroundColor ?? general . appBarBackgroundColor ,
732752 // Prevents the main content from scrolling weird
733753 overflowY : 'auto' ,
734754 // Cancel out the spacing produced by the page inset border when
0 commit comments