Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Scrollable] Set thin as the default with for scrollbar #11794

Merged
merged 1 commit into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/slimy-onions-join.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/polaris': patch
---

Set default scrollbar width to thin on scrollable
4 changes: 4 additions & 0 deletions polaris-react/src/components/Scrollable/Scrollable.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@
scrollbar-width: none;
}

.scrollbarWidthAuto {
scrollbar-width: auto;
}

.scrollbarGutterStable {
scrollbar-gutter: stable;
}
Expand Down
8 changes: 5 additions & 3 deletions polaris-react/src/components/Scrollable/Scrollable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ export interface ScrollableProps extends React.HTMLProps<HTMLDivElement> {
hint?: boolean;
/** Adds a tabIndex to scrollable when children are not focusable */
focusable?: boolean;
/** Browser determined scrollbar width */
scrollbarWidth?: 'thin' | 'none';
/** Browser determined scrollbar width
* @default 'thin'
*/
scrollbarWidth?: 'thin' | 'none' | 'auto';
/** Adds space to one or both sides to prevent content shift when scrolling is necessary */
scrollbarGutter?: 'stable' | 'stable both-edges';
/** Called when scrolled to the bottom of the scroll area */
Expand All @@ -67,7 +69,7 @@ const ScrollableComponent = forwardRef<ScrollableRef, ScrollableProps>(
shadow,
hint,
focusable,
scrollbarWidth,
scrollbarWidth = 'thin',
scrollbarGutter,
onScrolledToBottom,
...rest
Expand Down
Loading