Skip to content

Commit 8354de5

Browse files
vdepizzoljonrohan
andauthored
Fix layout sticky pane modifier name (#2087)
* Fix sticky pane modifier class name * Set SplitPageLayout pane sticky by default * Create nine-dragons-wave.md Co-authored-by: Jon Rohan <yes@jonrohan.codes>
1 parent 6836586 commit 8354de5

File tree

4 files changed

+17
-7
lines changed

4 files changed

+17
-7
lines changed

.changeset/nine-dragons-wave.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@primer/css": minor
3+
---
4+
5+
Changing `PageLayout--isPaneSticky` to `PageLayout--sticky`.

docs/src/stories/components/Layout/LayoutBeta.stories.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,6 @@ export const LayoutTemplate = ({
371371
paneWidth && layoutClassName + '--paneWidth-' + `${paneWidth}`,
372372
panePosition && layoutClassName + '--panePos-' + `${panePosition}`,
373373
hasPaneDivider && layoutClassName + '--hasPaneDivider',
374-
paneIsSticky && layoutClassName + '--isPaneSticky',
375374

376375
layoutClassName + '--responsive-' + `${responsiveVariant}`,
377376
responsiveVariant === 'separateRegions' && layoutClassName + '--responsive-primary-' + `${primaryRegion}`,
@@ -403,6 +402,7 @@ export const LayoutTemplate = ({
403402
className={clsx(
404403
layoutClassName + '-region',
405404
layoutClassName + '-pane',
405+
paneIsSticky && layoutClassName + '-pane--sticky',
406406
paneDividerWhenNarrow &&
407407
layoutClassName +
408408
'-region--dividerNarrow-' +
@@ -433,6 +433,7 @@ export const LayoutTemplate = ({
433433
className={clsx(
434434
layoutClassName + '-region',
435435
layoutClassName + '-pane',
436+
paneIsSticky && layoutClassName + '-pane--sticky',
436437
paneDividerWhenNarrow &&
437438
layoutClassName +
438439
'-region--dividerNarrow-' +

docs/src/stories/components/Layout/SplitPageLayout.stories.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ Playground.args = {
163163
// Pane
164164
hasPane: true,
165165
paneWidth: 'wide',
166+
paneIsSticky: true,
166167

167168
// Content
168169
contentWidth: 'full',

src/layout/page-layout.scss

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,15 @@ $Layout-responsive-variant-max-breakpoint: 'md' !default;
111111

112112
// sticky pane
113113

114-
&.PageLayout--isPaneSticky {
115-
.PageLayout-pane {
116-
position: sticky;
117-
top: 0;
118-
max-height: 100vh;
119-
overflow: auto;
114+
.PageLayout-pane--sticky {
115+
position: sticky;
116+
top: 0;
117+
max-height: 100vh;
118+
overflow: auto;
119+
scrollbar-width: thin;
120+
121+
@supports (max-height: 100dvh) {
122+
max-height: 100dvh;
120123
}
121124
}
122125

0 commit comments

Comments
 (0)