Skip to content

Commit

Permalink
Add back in scrollbar padding onto content
Browse files Browse the repository at this point in the history
  • Loading branch information
sophschneider committed Apr 17, 2024
1 parent 4b6cfa8 commit 8fde9f1
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .changeset/unlucky-coats-add.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
'@shopify/polaris': patch
---

Changed `Frame` content overflow-y from scroll to auto
Moved `Frame` scrollbar from main to content and set overflow-y from scroll to auto behind a feature flag
11 changes: 11 additions & 0 deletions polaris-react/src/components/Frame/Frame.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,17 @@
}
}

.ScrollbarSafeArea-TopBarAndReframe {
@media (--p-breakpoints-md-up) {
/* stylelint-disable -- polaris/conventions/polaris/custom-property-allowed-list -- Polaris component custom properties */
width: calc(
100vw - var(--pg-navigation-width) -
var(--pc-app-provider-scrollbar-width) - 6px
);
/* stylelint-enable -- polaris/conventions/polaris/custom-property-allowed-list */
}
}

.GlobalRibbonContainer {
position: fixed;
z-index: var(--p-z-index-3);
Expand Down
12 changes: 11 additions & 1 deletion polaris-react/src/components/Frame/Frame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,17 @@ class FrameInner extends PureComponent<CombinedProps, State> {
styles['Content-TopBarAndReframe'],
)}
>
{children}
{features?.dynamicTopBarAndReframe ? (
<div
className={
styles['ScrollbarSafeArea-TopBarAndReframe']
}
>
{children}
</div>
) : (
children
)}
</div>
</main>
</div>
Expand Down

0 comments on commit 8fde9f1

Please sign in to comment.