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

[Frame] Add custom scrollbar styles for reframe #11965

Merged
merged 8 commits into from
May 6, 2024
Merged

Conversation

sophschneider
Copy link
Contributor

@sophschneider sophschneider commented May 1, 2024

Edit: updated to use custom scrollbar styles instead of native ones

WHY are these changes introduced?

Fixes https://github.com/Shopify/polaris-backlog/issues/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

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

Screenshot 2024-05-06 at 12 03 45 PM

🎩 checklist

@sophschneider
Copy link
Contributor Author

/snapit

Copy link
Contributor

github-actions bot commented May 1, 2024

🫰✨ Thanks @sophschneider! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

"@shopify/polaris-migrator": "0.0.0-snapshot-20240501202738",
"@shopify/polaris": "0.0.0-snapshot-20240501202738",
"@shopify/polaris-tokens": "0.0.0-snapshot-20240501202738",
"@shopify/stylelint-polaris": "0.0.0-snapshot-20240501202738"

@sophschneider
Copy link
Contributor Author

/snapit

Copy link
Contributor

github-actions bot commented May 2, 2024

🫰✨ Thanks @sophschneider! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

"@shopify/polaris-migrator": "0.0.0-snapshot-20240501235837",
"@shopify/polaris": "0.0.0-snapshot-20240501235837",
"@shopify/polaris-tokens": "0.0.0-snapshot-20240501235837",
"@shopify/stylelint-polaris": "0.0.0-snapshot-20240501235837"

@sophschneider
Copy link
Contributor Author

/snapit

Copy link
Contributor

github-actions bot commented May 3, 2024

🫰✨ Thanks @sophschneider! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

"@shopify/polaris-migrator": "0.0.0-snapshot-20240503143119",
"@shopify/polaris": "0.0.0-snapshot-20240503143119",
"@shopify/polaris-tokens": "0.0.0-snapshot-20240503143119",
"@shopify/stylelint-polaris": "0.0.0-snapshot-20240503143119"

@sophschneider
Copy link
Contributor Author

/snapit

Copy link
Contributor

github-actions bot commented May 3, 2024

🫰✨ Thanks @sophschneider! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

"@shopify/polaris-migrator": "0.0.0-snapshot-20240503184723",
"@shopify/polaris": "0.0.0-snapshot-20240503184723",
"@shopify/polaris-tokens": "0.0.0-snapshot-20240503184723",
"@shopify/stylelint-polaris": "0.0.0-snapshot-20240503184723"

@sophschneider sophschneider marked this pull request as ready for review May 3, 2024 20:04
@sophschneider sophschneider changed the title Add scrollbar styles for reframe [Frame] Add scrollbar styles for reframe May 3, 2024
@sophschneider
Copy link
Contributor Author

/snapit

@sophschneider sophschneider marked this pull request as draft May 6, 2024 13:56
@sophschneider
Copy link
Contributor Author

putting this back in draft as we get feedback on two options

Copy link
Contributor

github-actions bot commented May 6, 2024

🫰✨ Thanks @sophschneider! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

"@shopify/polaris-migrator": "0.0.0-snapshot-20240506135640",
"@shopify/polaris": "0.0.0-snapshot-20240506135640",
"@shopify/polaris-tokens": "0.0.0-snapshot-20240506135640",
"@shopify/stylelint-polaris": "0.0.0-snapshot-20240506135640"

@sophschneider sophschneider changed the title [Frame] Add scrollbar styles for reframe [Frame] Add custom scrollbar styles for reframe May 6, 2024
@sophschneider sophschneider marked this pull request as ready for review May 6, 2024 16:08
@sophschneider
Copy link
Contributor Author

/snapit

Copy link
Contributor

github-actions bot commented May 6, 2024

🫰✨ Thanks @sophschneider! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

"@shopify/polaris-migrator": "0.0.0-snapshot-20240506163636",
"@shopify/polaris": "0.0.0-snapshot-20240506163636",
"@shopify/polaris-tokens": "0.0.0-snapshot-20240506163636",
"@shopify/stylelint-polaris": "0.0.0-snapshot-20240506163636"

@@ -462,6 +472,38 @@

.Scrollable {
width: 100%;

/* Not using the spaacer custom property so the space is applied always */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/* Not using the spaacer custom property so the space is applied always */
/* Not using the spacer custom property so the space is applied always */

@sophschneider sophschneider merged commit 7a70238 into main May 6, 2024
13 checks passed
@sophschneider sophschneider deleted the frame-scrollbar branch May 6, 2024 19:10
chloerice pushed a commit that referenced this pull request May 6, 2024
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @shopify/[email protected]

### Minor Changes

- [#11979](#11979)
[`982491f0f`](982491f)
Thanks [@kyledurand](https://github.com/kyledurand)! - Added `animateIn`
transition option to Collapsible


- [#11967](#11967)
[`e50472f85`](e50472f)
Thanks [@kyledurand](https://github.com/kyledurand)! - Added `variant`
prop to Collapsible

### Patch Changes

- [#11976](#11976)
[`4f3bf9948`](4f3bf99)
Thanks [@chloerice](https://github.com/chloerice)! - Fixed sibling
`FormLayout.Item` widths not remaining equal when wrapped in
`FormLayout.Group`


- [#11945](#11945)
[`b59743a76`](b59743a)
Thanks [@sophschneider](https://github.com/sophschneider)! - Added
offset width to reframe `Frame` and passed reframe scroll container to
sticky manager in `AppProvider`


- [#11965](#11965)
[`7a702388d`](7a70238)
Thanks [@sophschneider](https://github.com/sophschneider)! - Added
scrollbar styles for reframe


- [#11944](#11944)
[`d1d69e919`](d1d69e9)
Thanks [@stefanlegg](https://github.com/stefanlegg)! - Add support for
hiding selectable checkbox on a per `IndexTable.Row` basis via
`hideSelectable` prop\`


- [#11947](#11947)
[`995079cc7`](995079c)
Thanks [@sophschneider](https://github.com/sophschneider)! - Fixed
`Sticky` to update sticky items when props change

- Updated dependencies
\[[`12dbc2cd8`](12dbc2c),
[`8ce6211c9`](8ce6211),
[`7a702388d`](7a70238)]:
    -   @shopify/[email protected]

## @shopify/[email protected]

### Minor Changes

- [#11965](#11965)
[`7a702388d`](7a70238)
Thanks [@sophschneider](https://github.com/sophschneider)! - Added
`color-scrollbar-thumb-bg` token

### Patch Changes

- [#11981](#11981)
[`12dbc2cd8`](12dbc2c)
Thanks [@sophschneider](https://github.com/sophschneider)! - Updated
internal only whiteAlpha scale and dark experimental theme with new
values


- [#11853](#11853)
[`8ce6211c9`](8ce6211)
Thanks [@aaronccasanova](https://github.com/aaronccasanova)! - Added
`"sideEffect": "false"` to the `package.json` to enable treeshaking

## @shopify/[email protected]

### Patch Changes

- Updated dependencies
\[[`12dbc2cd8`](12dbc2c),
[`8ce6211c9`](8ce6211),
[`7a702388d`](7a70238)]:
    -   @shopify/[email protected]
    -   @shopify/[email protected]

## @shopify/[email protected]

### Patch Changes

- Updated dependencies
\[[`12dbc2cd8`](12dbc2c),
[`8ce6211c9`](8ce6211),
[`7a702388d`](7a70238)]:
    -   @shopify/[email protected]

## [email protected]

### Patch Changes

- Updated dependencies
\[[`12dbc2cd8`](12dbc2c),
[`8ce6211c9`](8ce6211),
[`7a702388d`](7a70238)]:
    -   @shopify/[email protected]

## [email protected]

### Patch Changes

- Updated dependencies
\[[`4f3bf9948`](4f3bf99),
[`b59743a76`](b59743a),
[`12dbc2cd8`](12dbc2c),
[`982491f0f`](982491f),
[`7a702388d`](7a70238),
[`8ce6211c9`](8ce6211),
[`e50472f85`](e50472f),
[`d1d69e919`](d1d69e9),
[`995079cc7`](995079c),
[`7a702388d`](7a70238)]:
    -   @shopify/[email protected]
    -   @shopify/[email protected]

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants