Skip to content

Commit 54b7c9e

Browse files
fix(theme): active sidebar nav link styles using aria-current under BackstageSidebar drawer (#2887)
1 parent d1f9b07 commit 54b7c9e

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@red-hat-developer-hub/backstage-plugin-theme': patch
3+
---
4+
5+
style the active sidebar nav link (a[aria-current="page"]) so selected colors match the resolved navigation shell

workspaces/theme/plugins/theme/src/utils/createComponents.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,15 @@ export const createComponents = (themeConfig: ThemeConfig): Components => {
634634
'& hr': {
635635
backgroundColor: general.sidebarDividerColor,
636636
},
637+
'#rhdh-sidebar-layout & a[aria-current="page"], & a[aria-current="page"]':
638+
{
639+
background: `${sidebarItemInteractionBackgroundColor} !important`,
640+
backgroundColor: `${sidebarItemInteractionBackgroundColor} !important`,
641+
color: `${navigationSelectedColor} !important`,
642+
'& .MuiTypography-root': {
643+
color: 'inherit !important',
644+
},
645+
},
637646
'& [class*="BackstageSidebarItem-selected-"][class*="BackstageSidebarItem-root-"]':
638647
{
639648
backgroundColor: `${sidebarItemInteractionBackgroundColor} !important`,

0 commit comments

Comments
 (0)