-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[LegacyCard] overflow clip to protect border radius #9263
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
Conversation
size-limit report 📦
|
c80fb86 to
c2fc88f
Compare
|
/snapit |
|
🫰✨ Thanks @mattkubej! Your snapshots have been published to npm. Test the snapshots by updating your yarn add @shopify/polaris-cli@0.0.0-snapshot-release-20230524183650yarn add @shopify/polaris@0.0.0-snapshot-release-20230524183650 |
|
Adding Looking at your Code Sandbox example, could we instead get away with using Browser support seems fine for An alternative could be to have We use |
|
Good catch @nickpresta! That seems like it should be a better choice in this circumstance. I'm going to update this PR and the spin instance, so it can be top hatted with clip to see if this has us covered. |
9ac88eb to
5249db6
Compare
|
/snapit |
|
🫰✨ Thanks @mattkubej! Your snapshots have been published to npm. Test the snapshots by updating your yarn add @shopify/polaris-cli@0.0.0-snapshot-release-20230530224523yarn add @shopify/polaris@0.0.0-snapshot-release-20230530224523 |
|
/snapit |
|
🫰✨ Thanks @mattkubej! Your snapshots have been published to npm. Test the snapshots by updating your yarn add @shopify/polaris-cli@0.0.0-snapshot-release-20230530235250yarn add @shopify/polaris@0.0.0-snapshot-release-20230530235250 |
5249db6 to
879b993
Compare
47578c7 to
203df38
Compare
|
Looks good to me 👍 |
nickpresta
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 LGTM for Analytics
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/polaris@11.1.0 ### Minor Changes - [#9269](#9269) [`bf3bc75a1`](bf3bc75) Thanks [@nat-king](https://github.com/nat-king)! - Added optional `onAddFilterClick` callback prop to the indexFilters component ### Patch Changes - [#9295](#9295) [`7e21fe093`](7e21fe0) Thanks [@chloerice](https://github.com/chloerice)! - Fixed `initials` overflowing when `Avatar` is round - [#9343](#9343) [`ae3208332`](ae32083) Thanks [@qt314](https://github.com/qt314)! - Alphabetized locale files - [#9314](#9314) [`e7d836819`](e7d8368) Thanks [@FCalabria](https://github.com/FCalabria)! - Removed focus styles on TextField while disabled - [#9223](#9223) [`221426aaf`](221426a) Thanks [@aveline](https://github.com/aveline)! - Deprecated `external` prop in `Link` component - [#9229](#9229) [`821535820`](8215358) Thanks [@aeperea](https://github.com/aeperea)! - Tabs update disabled state - [#9323](#9323) [`cd43c8b47`](cd43c8b) Thanks [@qt314](https://github.com/qt314)! - Added internationalized accessibility label to Banner dismiss button - [#9263](#9263) [`a3f3462a6`](a3f3462) Thanks [@mattkubej](https://github.com/mattkubej)! - Protect border radius of `LegacyCard` with overflow clip - [#9273](#9273) [`e823538ad`](e823538) Thanks [@aishad](https://github.com/aishad)! - Fixed inline padding on Modal Footer ## @shopify/polaris-cli@0.2.2 ## polaris.shopify.com@0.55.0 ### Minor Changes - [#9311](#9311) [`b6f2d7928`](b6f2d79) Thanks [@lgriffee](https://github.com/lgriffee)! - Created a "What's new" page for v11 token changes. ### Patch Changes - [#8840](#8840) [`a7569b7f5`](a7569b7) Thanks [@alex-page](https://github.com/alex-page)! - Updated Colors page with v11 content - Updated dependencies \[[`7e21fe093`](7e21fe0), [`ae3208332`](ae32083), [`e7d836819`](e7d8368), [`221426aaf`](221426a), [`821535820`](8215358), [`cd43c8b47`](cd43c8b), [`a3f3462a6`](a3f3462), [`e823538ad`](e823538), [`bf3bc75a1`](bf3bc75)]: - @shopify/polaris@11.1.0 Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
### WHY are these changes introduced? Fixes Shopify#9252 It is possible for child elements to sit on top and overflow the corners of the `LegacyCard`, which hid the border radius. This specifically addressed the use case of an IndexTable within a LegacyCard, but as seen within [Chromatic](https://shopify.chromatic.com/build?appId=5d559397bae39100201eedc1&number=17058) there were other areas that had overflow issues such as [SkeletonTabs](https://shopify.chromatic.com/test?appId=5d559397bae39100201eedc1&id=646e566ea99fb9a2fe5d19ac). Note: It does look like the Chromatic build highlights changes that do not appear to be related to the changes within this PR. As @nickpresta highlighted below, using `hidden` will cause issue with `position: sticky`, so this PR utilizes `clip`. This does mean that any sticky elements that are children of this card would also be clipped, but will continue to be sticky. ### WHAT is this pull request doing? Prevents child elements of `LegacyCard` from overflowing onto the corners of the container. This insures the border radius stays in tact. https://www.w3.org/TR/css-backgrounds-3/#corner-clipping ### How to 🎩 - [Storybook](https://storybook.web.legacy-card-overflow-clip.matt-kubej.us.spin.dev/?path=/story/all-components-legacycard--default) - [Spin](https://admin.web.legacy-card-overflow-clip.matt-kubej.us.spin.dev/store/shop1/products/inventory?location_id=1) - [Chromatic](https://shopify.chromatic.com/build?appId=5d559397bae39100201eedc1&number=17227) ### 🎩 checklist - [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) - [x] Updated the component's `README.md` with documentation changes - [x] [Tophatted documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md) changes in the style guide
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/polaris@11.1.0 ### Minor Changes - [Shopify#9269](Shopify#9269) [`bf3bc75a1`](Shopify@bf3bc75) Thanks [@nat-king](https://github.com/nat-king)! - Added optional `onAddFilterClick` callback prop to the indexFilters component ### Patch Changes - [Shopify#9295](Shopify#9295) [`7e21fe093`](Shopify@7e21fe0) Thanks [@chloerice](https://github.com/chloerice)! - Fixed `initials` overflowing when `Avatar` is round - [Shopify#9343](Shopify#9343) [`ae3208332`](Shopify@ae32083) Thanks [@qt314](https://github.com/qt314)! - Alphabetized locale files - [Shopify#9314](Shopify#9314) [`e7d836819`](Shopify@e7d8368) Thanks [@FCalabria](https://github.com/FCalabria)! - Removed focus styles on TextField while disabled - [Shopify#9223](Shopify#9223) [`221426aaf`](Shopify@221426a) Thanks [@aveline](https://github.com/aveline)! - Deprecated `external` prop in `Link` component - [Shopify#9229](Shopify#9229) [`821535820`](Shopify@8215358) Thanks [@aeperea](https://github.com/aeperea)! - Tabs update disabled state - [Shopify#9323](Shopify#9323) [`cd43c8b47`](Shopify@cd43c8b) Thanks [@qt314](https://github.com/qt314)! - Added internationalized accessibility label to Banner dismiss button - [Shopify#9263](Shopify#9263) [`a3f3462a6`](Shopify@a3f3462) Thanks [@mattkubej](https://github.com/mattkubej)! - Protect border radius of `LegacyCard` with overflow clip - [Shopify#9273](Shopify#9273) [`e823538ad`](Shopify@e823538) Thanks [@aishad](https://github.com/aishad)! - Fixed inline padding on Modal Footer ## @shopify/polaris-cli@0.2.2 ## polaris.shopify.com@0.55.0 ### Minor Changes - [Shopify#9311](Shopify#9311) [`b6f2d7928`](Shopify@b6f2d79) Thanks [@lgriffee](https://github.com/lgriffee)! - Created a "What's new" page for v11 token changes. ### Patch Changes - [Shopify#8840](Shopify#8840) [`a7569b7f5`](Shopify@a7569b7) Thanks [@alex-page](https://github.com/alex-page)! - Updated Colors page with v11 content - Updated dependencies \[[`7e21fe093`](Shopify@7e21fe0), [`ae3208332`](Shopify@ae32083), [`e7d836819`](Shopify@e7d8368), [`221426aaf`](Shopify@221426a), [`821535820`](Shopify@8215358), [`cd43c8b47`](Shopify@cd43c8b), [`a3f3462a6`](Shopify@a3f3462), [`e823538ad`](Shopify@e823538), [`bf3bc75a1`](Shopify@bf3bc75)]: - @shopify/polaris@11.1.0 Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
### WHY are these changes introduced? Fixes Shopify#9252 It is possible for child elements to sit on top and overflow the corners of the `LegacyCard`, which hid the border radius. This specifically addressed the use case of an IndexTable within a LegacyCard, but as seen within [Chromatic](https://shopify.chromatic.com/build?appId=5d559397bae39100201eedc1&number=17058) there were other areas that had overflow issues such as [SkeletonTabs](https://shopify.chromatic.com/test?appId=5d559397bae39100201eedc1&id=646e566ea99fb9a2fe5d19ac). Note: It does look like the Chromatic build highlights changes that do not appear to be related to the changes within this PR. As @nickpresta highlighted below, using `hidden` will cause issue with `position: sticky`, so this PR utilizes `clip`. This does mean that any sticky elements that are children of this card would also be clipped, but will continue to be sticky. ### WHAT is this pull request doing? Prevents child elements of `LegacyCard` from overflowing onto the corners of the container. This insures the border radius stays in tact. https://www.w3.org/TR/css-backgrounds-3/#corner-clipping ### How to 🎩 - [Storybook](https://storybook.web.legacy-card-overflow-clip.matt-kubej.us.spin.dev/?path=/story/all-components-legacycard--default) - [Spin](https://admin.web.legacy-card-overflow-clip.matt-kubej.us.spin.dev/store/shop1/products/inventory?location_id=1) - [Chromatic](https://shopify.chromatic.com/build?appId=5d559397bae39100201eedc1&number=17227) ### 🎩 checklist - [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) - [x] Updated the component's `README.md` with documentation changes - [x] [Tophatted documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md) changes in the style guide
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/polaris@11.1.0 ### Minor Changes - [Shopify#9269](Shopify#9269) [`bf3bc75a1`](Shopify@4c4ea3f) Thanks [@nat-king](https://github.com/nat-king)! - Added optional `onAddFilterClick` callback prop to the indexFilters component ### Patch Changes - [Shopify#9295](Shopify#9295) [`7e21fe093`](Shopify@1e6866e) Thanks [@chloerice](https://github.com/chloerice)! - Fixed `initials` overflowing when `Avatar` is round - [Shopify#9343](Shopify#9343) [`ae3208332`](Shopify@8e37127) Thanks [@qt314](https://github.com/qt314)! - Alphabetized locale files - [Shopify#9314](Shopify#9314) [`e7d836819`](Shopify@77a0b7f) Thanks [@FCalabria](https://github.com/FCalabria)! - Removed focus styles on TextField while disabled - [Shopify#9223](Shopify#9223) [`221426aaf`](Shopify@7a8633b) Thanks [@aveline](https://github.com/aveline)! - Deprecated `external` prop in `Link` component - [Shopify#9229](Shopify#9229) [`821535820`](Shopify@b3044bb) Thanks [@aeperea](https://github.com/aeperea)! - Tabs update disabled state - [Shopify#9323](Shopify#9323) [`cd43c8b47`](Shopify@6069404) Thanks [@qt314](https://github.com/qt314)! - Added internationalized accessibility label to Banner dismiss button - [Shopify#9263](Shopify#9263) [`a3f3462a6`](Shopify@813bf03) Thanks [@mattkubej](https://github.com/mattkubej)! - Protect border radius of `LegacyCard` with overflow clip - [Shopify#9273](Shopify#9273) [`e823538ad`](Shopify@4cc79bb) Thanks [@aishad](https://github.com/aishad)! - Fixed inline padding on Modal Footer ## @shopify/polaris-cli@0.2.2 ## polaris.shopify.com@0.55.0 ### Minor Changes - [Shopify#9311](Shopify#9311) [`b6f2d7928`](Shopify@7ddf98f) Thanks [@lgriffee](https://github.com/lgriffee)! - Created a "What's new" page for v11 token changes. ### Patch Changes - [Shopify#8840](Shopify#8840) [`a7569b7f5`](Shopify@7f0860a) Thanks [@alex-page](https://github.com/alex-page)! - Updated Colors page with v11 content - Updated dependencies \[[`7e21fe093`](Shopify@1e6866e), [`ae3208332`](Shopify@8e37127), [`e7d836819`](Shopify@77a0b7f), [`221426aaf`](Shopify@7a8633b), [`821535820`](Shopify@b3044bb), [`cd43c8b47`](Shopify@6069404), [`a3f3462a6`](Shopify@813bf03), [`e823538ad`](Shopify@4cc79bb), [`bf3bc75a1`](Shopify@4c4ea3f)]: - @shopify/polaris@11.1.0 Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

WHY are these changes introduced?
Fixes #9252
It is possible for child elements to sit on top and overflow the corners of the
LegacyCard, which hid the border radius. This specifically addressed the use case of an IndexTable within a LegacyCard, but as seen within Chromatic there were other areas that had overflow issues such as SkeletonTabs.Note: It does look like the Chromatic build highlights changes that do not appear to be related to the changes within this PR.
As @nickpresta highlighted below, using
hiddenwill cause issue withposition: sticky, so this PR utilizesclip. This does mean that any sticky elements that are children of this card would also be clipped, but will continue to be sticky.WHAT is this pull request doing?
Prevents child elements of
LegacyCardfrom overflowing onto the corners of the container. This insures the border radius stays in tact.https://www.w3.org/TR/css-backgrounds-3/#corner-clipping
How to 🎩
🎩 checklist
README.mdwith documentation changes