Skip to content

Commit

Permalink
Migrate --p-space-0 tokens in SCSS files to 0 (#8356)
Browse files Browse the repository at this point in the history
### WHY are these changes introduced?

While our team has decided to keep the `--p-space-0` token in our system
we don't need to be using it to replace unitless zero values.

### WHAT is this pull request doing?

Runs the `styles-replace-custom-property` migration from
`@shopify/polaris-migrator` to replace any instances of `--p-space-0`
with `0` in `polaris-react` Sass files. e.g.

```sh
npx @shopify/polaris-migrator styles-replace-custom-property \
  --decl="/.+/" --from="--p-space-0" --to="0" '../polaris-react/src/**/*.scss'
```
  • Loading branch information
lgriffee committed Feb 17, 2023
1 parent bc8ab02 commit 6f92bf3
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 18 deletions.
5 changes: 5 additions & 0 deletions .changeset/calm-vans-guess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/polaris': minor
---

Migrated `--p-space-0` tokens to `0` in SCSS files
10 changes: 5 additions & 5 deletions polaris-react/src/components/Card/Card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
}

@media print and #{$p-breakpoints-sm-up} {
padding: var(--p-space-2) var(--p-space-4) var(--p-space-0);
padding: var(--p-space-2) var(--p-space-4) 0;
}
}

Expand Down Expand Up @@ -86,18 +86,18 @@
}

.Section-fullWidth {
padding: var(--p-space-4) var(--p-space-0);
padding: var(--p-space-4) 0;

@media #{$p-breakpoints-sm-up} {
padding: var(--p-space-5) var(--p-space-0);
padding: var(--p-space-5) 0;
}
}

.Section-flush {
padding: var(--p-space-0);
padding: 0;

@media #{$p-breakpoints-sm-up} {
padding: var(--p-space-0);
padding: 0;
}
}

Expand Down
10 changes: 5 additions & 5 deletions polaris-react/src/components/LegacyCard/LegacyCard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
}

@media print and #{$p-breakpoints-sm-up} {
padding: var(--p-space-2) var(--p-space-4) var(--p-space-0);
padding: var(--p-space-2) var(--p-space-4) 0;
}
}

Expand Down Expand Up @@ -86,18 +86,18 @@
}

.Section-fullWidth {
padding: var(--p-space-4) var(--p-space-0);
padding: var(--p-space-4) 0;

@media #{$p-breakpoints-sm-up} {
padding: var(--p-space-5) var(--p-space-0);
padding: var(--p-space-5) 0;
}
}

.Section-flush {
padding: var(--p-space-0);
padding: 0;

@media #{$p-breakpoints-sm-up} {
padding: var(--p-space-0);
padding: 0;
}
}

Expand Down
6 changes: 3 additions & 3 deletions polaris-react/src/components/LegacyStack/LegacyStack.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

.spacingNone {
// stylelint-disable-next-line -- Polaris component custom properties
--pc-stack-spacing: var(--p-space-0);
--pc-stack-spacing: 0;
}

.spacingExtraTight {
Expand Down Expand Up @@ -117,10 +117,10 @@

.vertical {
flex-direction: column;
margin-left: var(--p-space-0);
margin-left: 0;

> .Item {
margin-left: var(--p-space-0);
margin-left: 0;
}
}

Expand Down
6 changes: 3 additions & 3 deletions polaris-react/src/components/Stack/Stack.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

.spacingNone {
// stylelint-disable-next-line -- Polaris component custom properties
--pc-stack-spacing: var(--p-space-0);
--pc-stack-spacing: 0;
}

.spacingExtraTight {
Expand Down Expand Up @@ -117,10 +117,10 @@

.vertical {
flex-direction: column;
margin-left: var(--p-space-0);
margin-left: 0;

> .Item {
margin-left: var(--p-space-0);
margin-left: 0;
}
}

Expand Down
4 changes: 2 additions & 2 deletions polaris-react/src/components/TextField/TextField.scss
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,8 @@ $spinner-icon-size: 12px;
width: 100%;

> .Input {
padding-left: var(--p-space-0);
padding-right: var(--p-space-0);
padding-left: 0;
padding-right: 0;
}

@media #{$p-breakpoints-sm-up} {
Expand Down

0 comments on commit 6f92bf3

Please sign in to comment.