Skip to content

Commit

Permalink
Fix layout sticky pane modifier name (#2087)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
vdepizzol and jonrohan authored May 20, 2022
1 parent 6836586 commit 8354de5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/nine-dragons-wave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/css": minor
---

Changing `PageLayout--isPaneSticky` to `PageLayout--sticky`.
3 changes: 2 additions & 1 deletion docs/src/stories/components/Layout/LayoutBeta.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,6 @@ export const LayoutTemplate = ({
paneWidth && layoutClassName + '--paneWidth-' + `${paneWidth}`,
panePosition && layoutClassName + '--panePos-' + `${panePosition}`,
hasPaneDivider && layoutClassName + '--hasPaneDivider',
paneIsSticky && layoutClassName + '--isPaneSticky',

layoutClassName + '--responsive-' + `${responsiveVariant}`,
responsiveVariant === 'separateRegions' && layoutClassName + '--responsive-primary-' + `${primaryRegion}`,
Expand Down Expand Up @@ -403,6 +402,7 @@ export const LayoutTemplate = ({
className={clsx(
layoutClassName + '-region',
layoutClassName + '-pane',
paneIsSticky && layoutClassName + '-pane--sticky',
paneDividerWhenNarrow &&
layoutClassName +
'-region--dividerNarrow-' +
Expand Down Expand Up @@ -433,6 +433,7 @@ export const LayoutTemplate = ({
className={clsx(
layoutClassName + '-region',
layoutClassName + '-pane',
paneIsSticky && layoutClassName + '-pane--sticky',
paneDividerWhenNarrow &&
layoutClassName +
'-region--dividerNarrow-' +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ Playground.args = {
// Pane
hasPane: true,
paneWidth: 'wide',
paneIsSticky: true,

// Content
contentWidth: 'full',
Expand Down
15 changes: 9 additions & 6 deletions src/layout/page-layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,15 @@ $Layout-responsive-variant-max-breakpoint: 'md' !default;

// sticky pane

&.PageLayout--isPaneSticky {
.PageLayout-pane {
position: sticky;
top: 0;
max-height: 100vh;
overflow: auto;
.PageLayout-pane--sticky {
position: sticky;
top: 0;
max-height: 100vh;
overflow: auto;
scrollbar-width: thin;

@supports (max-height: 100dvh) {
max-height: 100dvh;
}
}

Expand Down

0 comments on commit 8354de5

Please sign in to comment.