-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Frame] Add custom scrollbar styles for reframe (#11965)
Edit: updated to use custom scrollbar styles instead of native ones ### WHY are these changes introduced? Fixes Shopify/archive-polaris-backlog-2024#1379 ### WHAT is this pull request doing? https://admin.web.custom-scroll.sophie-schneider.us.spin.dev/store/shop1 |Change|Why?| |-|-| |Adds a `2px` margin to the right of the scrollbar|so it fits within the rounded corner container| |Use custom scrollbar|Match our other scrollbars in the admin, hide the track so the right margin is less obvious. Using native scrollbars on safari and `webkit` pseudo selector doesn't respect user's OS scroll settings| |Add lighter token for rest state of scrollbar|I cannot style the scrollbar thumb hover state without the `webkit` pseudo selector so this changes the scrollbar color depending on whether or not the user is hovering over the full scroll container| ### Potential future improvements 1. Add a larger margin on firefox so the scrollbar isn't cut off there 2. Implement and "Overlay scrollbar" when "Always show scrollbars" setting is on 3. Add border line for when "Always show scrollbars" setting is on to always show the scroll track even when there isn't scrollable content See demo below where there isn't a layout shift for the "Always show scrollbars" setting on but it causes the content to look off centre because of the gutter. ![Screen Recording 2024-05-03 at 3 51 37 PM](https://github.com/Shopify/polaris/assets/20652326/e9943bed-dcd6-460c-a8f0-dabbdcc6bb90) ### How to 🎩 https://admin.web.custom-scroll.sophie-schneider.us.spin.dev/store/shop1 Tophat with OS scroll settings set to "Always" and "When scrolling" Check on chrome, firefox, safari, edge <img width="713" alt="Screenshot 2024-05-06 at 12 03 45 PM" src="https://github.com/Shopify/polaris/assets/20652326/ef9cfc0c-bd57-46d6-80d8-15795f1e84ab"> ### 🎩 checklist - [x] Tested a [snapshot](https://github.com/Shopify/polaris/blob/main/documentation/Releasing.md#-snapshot-releases) - [x] Tested on [mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing) - [x] Tested on [multiple browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers) - [x] Tested for [accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md)
- Loading branch information
1 parent
4f3bf99
commit 7a70238
Showing
5 changed files
with
79 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@shopify/polaris': patch | ||
--- | ||
|
||
Added scrollbar styles for reframe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@shopify/polaris-tokens': minor | ||
--- | ||
|
||
Added `color-scrollbar-thumb-bg` token |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters