Skip to content

Commit a10eda8

Browse files
committed
fix: do not target classnames
1 parent a9fefbe commit a10eda8

File tree

1 file changed

+7
-3
lines changed
  • packages/app/src/components/Root

1 file changed

+7
-3
lines changed

packages/app/src/components/Root/Root.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ import { SidebarLogo } from './SidebarLogo';
4848
* to support the application headers (and the global header plugin)
4949
* without having multiple scrollbars.
5050
*
51+
* Note that we cannot target class names directly, due to obfuscation in production builds.
52+
*
5153
* This solves also the duplicate scrollbar issues in tech docs:
5254
* https://issues.redhat.com/browse/RHIDP-4637 (Scrollbar for docs behaves weirdly if there are over a page of headings)
5355
*
@@ -120,7 +122,8 @@ const SidebarLayout = styled(Box, {
120122
flexGrow: 1,
121123
maxHeight: `calc(100vh - ${aboveSidebarHeaderHeight ?? 0}px)`,
122124

123-
'& div[class*="BackstageSidebarPage"]': {
125+
'& > div': {
126+
// BackstageSidebarPage-root
124127
display: 'flex',
125128
flexDirection: 'column',
126129
height: 'unset',
@@ -137,14 +140,15 @@ const SidebarLayout = styled(Box, {
137140
},
138141

139142
// The height is controlled by the flexbox in the BackstageSidebarPage.
140-
'& main[class*="BackstagePage-root"]': {
143+
'& main': {
141144
height: `calc(100vh - ${aboveSidebarHeaderHeight! + aboveMainContentHeaderHeight!}px)`,
142145
flexGrow: 1,
143146
},
144147

145148
// We need to compensate for the above-sidebar position of the global header
146149
// 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
148152
top: `max(0px, ${aboveSidebarHeaderHeight ?? 0}px)`,
149153
},
150154
}),

0 commit comments

Comments
 (0)