Skip to content

Commit

Permalink
chore: set thin as the default with for scrollbar on scrollable
Browse files Browse the repository at this point in the history
  • Loading branch information
kyledurand committed Mar 27, 2024
1 parent df52763 commit dffc762
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
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

0 comments on commit dffc762

Please sign in to comment.