@@ -48,6 +48,8 @@ import { SidebarLogo } from './SidebarLogo';
48
48
* to support the application headers (and the global header plugin)
49
49
* without having multiple scrollbars.
50
50
*
51
+ * Note that we cannot target class names directly, due to obfuscation in production builds.
52
+ *
51
53
* This solves also the duplicate scrollbar issues in tech docs:
52
54
* https://issues.redhat.com/browse/RHIDP-4637 (Scrollbar for docs behaves weirdly if there are over a page of headings)
53
55
*
@@ -120,7 +122,8 @@ const SidebarLayout = styled(Box, {
120
122
flexGrow : 1 ,
121
123
maxHeight : `calc(100vh - ${ aboveSidebarHeaderHeight ?? 0 } px)` ,
122
124
123
- '& div[class*="BackstageSidebarPage"]' : {
125
+ '& > div' : {
126
+ // BackstageSidebarPage-root
124
127
display : 'flex' ,
125
128
flexDirection : 'column' ,
126
129
height : 'unset' ,
@@ -137,14 +140,15 @@ const SidebarLayout = styled(Box, {
137
140
} ,
138
141
139
142
// The height is controlled by the flexbox in the BackstageSidebarPage.
140
- '& main[class*="BackstagePage-root"] ' : {
143
+ '& main' : {
141
144
height : `calc(100vh - ${ aboveSidebarHeaderHeight ! + aboveMainContentHeaderHeight ! } px)` ,
142
145
flexGrow : 1 ,
143
146
} ,
144
147
145
148
// We need to compensate for the above-sidebar position of the global header
146
149
// as it takes up a fixed height at the top of the page.
147
- '& div[class*="BackstageSidebar-drawer"]' : {
150
+ '& > div > nav > div > div' : {
151
+ // BackstageSidebarPage-root > nav > BackstageSidebar-root > BackstageSidebar-drawer
148
152
top : `max(0px, ${ aboveSidebarHeaderHeight ?? 0 } px)` ,
149
153
} ,
150
154
} ) ,
0 commit comments