-
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.
[Bleed] Refactor props to use logical property names (#7779)
### WHY are these changes introduced? Resolves #7772. Updates `Bleed` to use logical properties. Style guide has been updated to reflect new prop names. [Storybook](https://5d559397bae39100201eedc1-jximmitnfv.chromatic.com/?path=/story/all-components-bleed--with-specific-direction). ### WHAT is this pull request doing? Updates `Bleed` to use logical properties: - `vertical` -> `marginBlock` - `horizontal` -> `marginInline` - `top` -> `marginBlockStart` - `bottom` -> `marginBlockEnd` - `left` -> `marginInlineStart` - `right` -> `marginInlineEnd` The logic to get the negative margins when `horizontal` or `vertical` was passed in was flipped and causing issues so I've also fixed that. ### How to 🎩 🖥 [Local development instructions](https://github.com/Shopify/polaris/blob/main/README.md#local-development) 🗒 [General tophatting guidelines](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md) 📄 [Changelog guidelines](https://github.com/Shopify/polaris/blob/main/.github/CONTRIBUTING.md#changelog) ### 🎩 checklist - [x] Tested on [mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing) - [ ] Tested on [multiple browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers) - [ ] Tested for [accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md) - [ ] 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
- Loading branch information
Showing
10 changed files
with
525 additions
and
490 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,6 @@ | ||
--- | ||
'@shopify/polaris': patch | ||
'polaris.shopify.com': patch | ||
--- | ||
|
||
Updated `Bleed` props to use logical properties, fixed reversed logic for horizontal/vertical bleed, and updated style guide |
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 |
---|---|---|
@@ -1,10 +1,8 @@ | ||
@import '../../styles/common'; | ||
|
||
.Bleed { | ||
/* stylelint-disable declaration-block-no-redundant-longhand-properties */ | ||
margin-bottom: calc(-1 * var(--pc-bleed-margin-bottom)); | ||
margin-left: calc(-1 * var(--pc-bleed-margin-left)); | ||
margin-right: calc(-1 * var(--pc-bleed-margin-right)); | ||
margin-top: calc(-1 * var(--pc-bleed-margin-top)); | ||
/* stylelint-enable declaration-block-no-redundant-longhand-properties */ | ||
margin-block-start: calc(-1 * var(--pc-bleed-margin-block-start)); | ||
margin-block-end: calc(-1 * var(--pc-bleed-margin-block-end)); | ||
margin-inline-start: calc(-1 * var(--pc-bleed-margin-inline-start)); | ||
margin-inline-end: calc(-1 * var(--pc-bleed-margin-inline-end)); | ||
} |
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
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
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
Oops, something went wrong.