Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated
Bleed
to accept responsive spacing (#7794)
### WHY are these changes introduced? Resolves #7792 and unblocks #7354 ### WHAT is this pull request doing? - Add support for responsive spacing values to be passed in to `Bleed` - Created the responsive custom properties manually instead of using the mixin because the mixin doesn't currently support applying the negative values with `calc()`. Not sure it's a use case we will run into enough to warrant adding the complexity to the mixin to support this. However if that is something we find ourselves needing to do repeatedly then worth revisiting the mixin.
- Loading branch information
Showing
6 changed files
with
724 additions
and
616 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': minor | ||
'polaris.shopify.com': patch | ||
--- | ||
|
||
Added support for responsive spacing on `Bleed` |
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,8 +1,56 @@ | ||
@import '../../styles/common'; | ||
|
||
.Bleed { | ||
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)); | ||
--pc-bleed-margin-block-start-xs: initial; | ||
--pc-bleed-margin-block-start-sm: var(--pc-bleed-margin-block-start-xs); | ||
--pc-bleed-margin-block-start-md: var(--pc-bleed-margin-block-start-sm); | ||
--pc-bleed-margin-block-start-lg: var(--pc-bleed-margin-block-start-md); | ||
--pc-bleed-margin-block-start-xl: var(--pc-bleed-margin-block-start-lg); | ||
--pc-bleed-margin-block-end-xs: initial; | ||
--pc-bleed-margin-block-end-sm: var(--pc-bleed-margin-block-end-xs); | ||
--pc-bleed-margin-block-end-md: var(--pc-bleed-margin-block-end-sm); | ||
--pc-bleed-margin-block-end-lg: var(--pc-bleed-margin-block-end-md); | ||
--pc-bleed-margin-block-end-xl: var(--pc-bleed-margin-block-end-lg); | ||
--pc-bleed-margin-inline-start-xs: initial; | ||
--pc-bleed-margin-inline-start-sm: var(--pc-bleed-margin-inline-start-xs); | ||
--pc-bleed-margin-inline-start-md: var(--pc-bleed-margin-inline-start-sm); | ||
--pc-bleed-margin-inline-start-lg: var(--pc-bleed-margin-inline-start-md); | ||
--pc-bleed-margin-inline-start-xl: var(--pc-bleed-margin-inline-start-lg); | ||
--pc-bleed-margin-inline-end-xs: initial; | ||
--pc-bleed-margin-inline-end-sm: var(--pc-bleed-margin-inline-end-xs); | ||
--pc-bleed-margin-inline-end-md: var(--pc-bleed-margin-inline-end-sm); | ||
--pc-bleed-margin-inline-end-lg: var(--pc-bleed-margin-inline-end-md); | ||
--pc-bleed-margin-inline-end-xl: var(--pc-bleed-margin-inline-end-lg); | ||
margin-block-start: calc(-1 * var(--pc-bleed-margin-block-start-xs)); | ||
margin-block-end: calc(-1 * var(--pc-bleed-margin-block-end-xs)); | ||
margin-inline-start: calc(-1 * var(--pc-bleed-margin-inline-start-xs)); | ||
margin-inline-end: calc(-1 * var(--pc-bleed-margin-inline-end-xs)); | ||
|
||
@media #{$p-breakpoints-sm-up} { | ||
margin-block-start: calc(-1 * var(--pc-bleed-margin-block-start-sm)); | ||
margin-block-end: calc(-1 * var(--pc-bleed-margin-block-end-sm)); | ||
margin-inline-start: calc(-1 * var(--pc-bleed-margin-inline-start-sm)); | ||
margin-inline-end: calc(-1 * var(--pc-bleed-margin-inline-end-sm)); | ||
} | ||
|
||
@media #{$p-breakpoints-md-up} { | ||
margin-block-start: calc(-1 * var(--pc-bleed-margin-block-start-md)); | ||
margin-block-end: calc(-1 * var(--pc-bleed-margin-block-end-md)); | ||
margin-inline-start: calc(-1 * var(--pc-bleed-margin-inline-start-md)); | ||
margin-inline-end: calc(-1 * var(--pc-bleed-margin-inline-end-md)); | ||
} | ||
|
||
@media #{$p-breakpoints-lg-up} { | ||
margin-block-start: calc(-1 * var(--pc-bleed-margin-block-start-lg)); | ||
margin-block-end: calc(-1 * var(--pc-bleed-margin-block-end-lg)); | ||
margin-inline-start: calc(-1 * var(--pc-bleed-margin-inline-start-lg)); | ||
margin-inline-end: calc(-1 * var(--pc-bleed-margin-inline-end-lg)); | ||
} | ||
|
||
@media #{$p-breakpoints-xl-up} { | ||
margin-block-start: calc(-1 * var(--pc-bleed-margin-block-start-xl)); | ||
margin-block-end: calc(-1 * var(--pc-bleed-margin-block-end-xl)); | ||
margin-inline-start: calc(-1 * var(--pc-bleed-margin-inline-start-xl)); | ||
margin-inline-end: calc(-1 * var(--pc-bleed-margin-inline-end-xl)); | ||
} | ||
} |
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.