Skip to content

Commit 47c1791

Browse files
Migrate border custom properties from v10 to v11 (Shopify#8879)
## WHY are these changes introduced? Part of Shopify#8405 ## WHAT is this pull request doing? Runs the [`v11-styles-replace-custom-property-border`](https://github.com/Shopify/polaris/blob/6e3696a9c99b7295acf99b505d858e982208600d/polaris-migrator/src/migrations/v11-styles-replace-custom-property-border/v11-styles-replace-custom-property-border.ts) from `@shopify/polaris-migrator` to migrate `border` custom properties from `v10` to `v11`. e.g. ```sh cd polaris-react npx @shopify/polaris-migrator v11-styles-replace-custom-property-border './src/**/*.scss' npx prettier --write "./src/**/*.scss" yarn lint:styles ``` This PR changes the `BorderAliasTokens` in the `Divider` component. As a result, there are slight visual changes to the `Divider` component border colors. Please see screenshots of documentation changes below: ### polaris.shopify.com **Before** <img width="1760" alt="Screenshot 2023-04-11 at 11 40 06 AM" src="https://user-images.githubusercontent.com/21976492/231247036-e7fb726d-2160-4c71-a292-c8438b4d682b.png"> **After** <img width="1774" alt="Screenshot 2023-04-11 at 11 48 52 AM" src="https://user-images.githubusercontent.com/21976492/231247072-3f9bd2d0-b32b-41bf-98d5-d2d5c4e7d488.png"> #### Storybook **Before** <img width="1772" alt="Screenshot 2023-04-11 at 11 51 44 AM" src="https://user-images.githubusercontent.com/21976492/231247343-0bbb2d79-89e0-4fed-ba77-7363597e496c.png"> **After** <img width="1776" alt="Screenshot 2023-04-11 at 11 40 26 AM" src="https://user-images.githubusercontent.com/21976492/231247092-b020ca72-2e0a-4269-bd46-30953200ca39.png"> --------- Co-authored-by: Aaron Casanova <[email protected]>
1 parent e5b84e6 commit 47c1791

File tree

34 files changed

+63
-58
lines changed

34 files changed

+63
-58
lines changed

.changeset/tough-planets-happen.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@shopify/polaris': minor
3+
---
4+
5+
Migrate `border` custom properties from Polaris `v10` to `v11`

polaris-react/src/components/AlphaCard/AlphaCard.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export const AlphaCard = ({
3636
roundedAbove,
3737
}: AlphaCardProps) => {
3838
const breakpoints = useBreakpoints();
39-
const defaultBorderRadius = '2' as BorderRadiusScale;
39+
const defaultBorderRadius: BorderRadiusScale = '2';
4040

4141
let hasBorderRadius = !roundedAbove;
4242

polaris-react/src/components/AlphaFilters/AlphaFilters.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
.Container {
44
position: relative;
55
z-index: var(--p-z-index-1);
6-
border-bottom: var(--p-border-divider);
6+
border-bottom: var(--p-border-width-1) solid var(--p-color-border-subdued);
77
border-top-left-radius: var(--p-border-radius-2);
88
border-top-right-radius: var(--p-border-radius-2);
99
background: var(--p-color-bg);
@@ -31,7 +31,7 @@
3131
}
3232

3333
.FiltersWrapper {
34-
border-bottom: var(--p-border-divider);
34+
border-bottom: var(--p-border-width-1) solid var(--p-color-border-subdued);
3535
height: 53px;
3636
overflow: hidden;
3737

polaris-react/src/components/Card/Card.scss

+4-4
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
}
6363

6464
+ .Section {
65-
border-top: var(--p-border-divider);
65+
border-top: var(--p-border-width-1) solid var(--p-color-border-subdued);
6666

6767
@media print {
6868
border-top: 0;
@@ -109,7 +109,7 @@
109109
}
110110

111111
.Header + & {
112-
border-top: var(--p-border-divider);
112+
border-top: var(--p-border-width-1) solid var(--p-color-border-subdued);
113113
margin-top: var(--p-space-5);
114114
}
115115
}
@@ -132,7 +132,7 @@
132132
+ .Subsection {
133133
margin-top: var(--p-space-4);
134134
padding-top: var(--p-space-4);
135-
border-top: var(--p-border-divider);
135+
border-top: var(--p-border-width-1) solid var(--p-color-border-subdued);
136136

137137
@media print {
138138
border-top: 0;
@@ -159,7 +159,7 @@
159159
}
160160

161161
.Section-subdued + & {
162-
border-top: var(--p-border-divider);
162+
border-top: var(--p-border-width-1) solid var(--p-color-border-subdued);
163163
padding: var(--p-space-5);
164164
}
165165
}

polaris-react/src/components/ColorPicker/ColorPicker.stories.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export function WithHexTextField() {
7575
minHeight: 'calc(100% - 0.125rem)',
7676
aspectRatio: '1 / 1',
7777
borderRadius: 'var(--p-border-radius-1)',
78-
border: 'var(--p-border-divider)',
78+
border: 'var(--p-border-width-1) solid var(--p-color-border-subdued)',
7979
backgroundColor: hsbToHex(color),
8080
},
8181
TextField: {

polaris-react/src/components/DataTable/DataTable.scss

+6-6
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
// stylelint-disable selector-max-class, selector-max-combinators, selector-max-specificity, selector-max-compound-selectors -- generated by polaris-migrator DO NOT COPY
6363
.TableRow + .TableRow {
6464
.Cell {
65-
border-top: var(--p-border-divider);
65+
border-top: var(--p-border-width-1) solid var(--p-color-border-subdued);
6666
}
6767
}
6868

@@ -101,7 +101,7 @@
101101
top: 0;
102102
right: 0;
103103
bottom: 0;
104-
border-right: var(--p-border-divider);
104+
border-right: var(--p-border-width-1) solid var(--p-color-border-subdued);
105105
}
106106

107107
.Cell-firstColumn {
@@ -124,7 +124,7 @@
124124
.Cell-header {
125125
font-weight: var(--p-font-weight-regular);
126126
color: var(--p-color-text);
127-
border-bottom: var(--p-border-divider);
127+
border-bottom: var(--p-border-width-1) solid var(--p-color-border-subdued);
128128
border-top: 0;
129129

130130
.IncreasedTableDensity & {
@@ -270,7 +270,7 @@
270270
.Cell-total {
271271
font-weight: var(--p-font-weight-semibold);
272272
background: var(--p-color-bg-subdued);
273-
border-bottom: var(--p-border-divider);
273+
border-bottom: var(--p-border-width-1) solid var(--p-color-border-subdued);
274274

275275
.ZebraStripingOnData.ShowTotals & {
276276
background: var(--p-color-bg-subdued);
@@ -283,7 +283,7 @@
283283
}
284284

285285
.Cell-total-footer {
286-
border-top: var(--p-border-divider);
286+
border-top: var(--p-border-width-1) solid var(--p-color-border-subdued);
287287
border-bottom: none;
288288

289289
&:first-child {
@@ -300,7 +300,7 @@
300300
background: var(--p-color-bg-subdued);
301301
color: var(--p-color-text-subdued);
302302
text-align: center;
303-
border-top: var(--p-border-divider);
303+
border-top: var(--p-border-width-1) solid var(--p-color-border-subdued);
304304
border-bottom-left-radius: var(--p-border-radius-2);
305305
border-bottom-right-radius: var(--p-border-radius-2);
306306

polaris-react/src/components/DescriptionList/DescriptionList.scss

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
// stylelint-disable-next-line selector-max-class, selector-max-combinators -- generated by polaris-migrator DO NOT COPY
3232
.Description + & + .Description {
33-
border-top: var(--p-border-divider);
33+
border-top: var(--p-border-width-1) solid var(--p-color-border-subdued);
3434
}
3535
}
3636
}
@@ -44,7 +44,7 @@
4444
}
4545

4646
+ .Term {
47-
border-top: var(--p-border-divider);
47+
border-top: var(--p-border-width-1) solid var(--p-color-border-subdued);
4848
}
4949

5050
@media #{$p-breakpoints-sm-up} {
@@ -57,7 +57,7 @@
5757

5858
// stylelint-disable-next-line selector-max-class, selector-max-combinators -- generated by polaris-migrator DO NOT COPY
5959
+ .Term + .Description {
60-
border-top: var(--p-border-divider);
60+
border-top: var(--p-border-width-1) solid var(--p-color-border-subdued);
6161
}
6262
}
6363
}

polaris-react/src/components/Divider/Divider.stories.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ export function WithBorderStyles() {
1818
</Text>
1919
<Divider />
2020
<Text as="h1" variant="headingXs">
21-
Dark
21+
Border
2222
</Text>
2323
<Divider borderColor="border" />
2424
<Text as="h1" variant="headingXs">
25-
Divider on dark
25+
Border inverse
2626
</Text>
2727
<Divider borderColor="border-inverse" />
2828
<Text as="h1" variant="headingXs">

polaris-react/src/components/Filters/Filters.scss

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ $list-filters-footer-height: 70px;
1919
top: 0;
2020
width: 100%;
2121
padding: var(--p-space-4) var(--p-space-5);
22-
border-bottom: var(--p-border-divider);
22+
border-bottom: var(--p-border-width-1) solid var(--p-color-border-subdued);
2323
height: $list-filters-header-height;
2424
box-sizing: border-box;
2525
display: flex;
@@ -46,7 +46,7 @@ $list-filters-footer-height: 70px;
4646
bottom: 0;
4747
width: 100%;
4848
padding: var(--p-space-4) var(--p-space-5);
49-
border-top: var(--p-border-divider);
49+
border-top: var(--p-border-width-1) solid var(--p-color-border-subdued);
5050
height: $list-filters-footer-height;
5151
box-sizing: border-box;
5252
display: flex;
@@ -65,7 +65,7 @@ $list-filters-footer-height: 70px;
6565
}
6666

6767
.EmptyFooterState {
68-
border-top: var(--p-border-divider);
68+
border-top: var(--p-border-width-1) solid var(--p-color-border-subdued);
6969
padding-top: var(--p-space-4);
7070
width: 100%;
7171
display: flex;

polaris-react/src/components/FullscreenBar/FullscreenBar.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
padding-left: var(--p-space-3);
1616
padding-right: var(--p-space-3);
1717
border-width: 0;
18-
border-right: var(--p-border-base);
18+
border-right: var(--p-border-width-1) solid var(--p-color-border-subdued);
1919
background-color: var(--p-color-bg);
2020
font-weight: var(--p-font-weight-medium);
2121
cursor: pointer;

polaris-react/src/components/IndexFilters/IndexFilters.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ $spinner-size: 20px;
8787
@media #{$p-breakpoints-md-down} {
8888
position: relative;
8989
padding: var(--p-space-3) var(--p-space-4);
90-
border-left: var(--p-border-divider);
90+
border-left: var(--p-border-width-1) solid var(--p-color-border-subdued);
9191
gap: var(--p-space-2);
9292

9393
&::before {

polaris-react/src/components/IndexFilters/components/Container/Container.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@import '../../../../styles/common';
22

33
.Container {
4-
border-bottom: var(--p-border-divider);
4+
border-bottom: var(--p-border-width-1) solid var(--p-color-border-subdued);
55
border-top-left-radius: var(--p-border-radius-2);
66
border-top-right-radius: var(--p-border-radius-2);
77
background: var(--p-color-bg);

polaris-react/src/components/IndexTable/IndexTable.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@ $scroll-bar-size: var(--p-space-2);
725725
transform: translateX(calc(-1 * var(--pc-index-table-translate-offset)));
726726
transition: transform var(--p-ease) var(--p-duration-200);
727727
display: flex;
728-
border-top: var(--p-border-divider);
728+
border-top: var(--p-border-width-1) solid var(--p-color-border-subdued);
729729
filter: none;
730730
align-items: center;
731731
}

polaris-react/src/components/Layout/Layout.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ $relative-size: $primary-basis / $secondary-basis;
6969
+ .AnnotatedSection {
7070
@media #{$p-breakpoints-sm-up} {
7171
padding-top: var(--p-space-4);
72-
border-top: var(--p-border-divider);
72+
border-top: var(--p-border-width-1) solid var(--p-color-border-subdued);
7373
}
7474
}
7575
}

polaris-react/src/components/LegacyCard/LegacyCard.scss

+4-4
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
}
6363

6464
+ .Section {
65-
border-top: var(--p-border-divider);
65+
border-top: var(--p-border-width-1) solid var(--p-color-border-subdued);
6666

6767
@media print {
6868
border-top: 0;
@@ -109,7 +109,7 @@
109109
}
110110

111111
.Header + & {
112-
border-top: var(--p-border-divider);
112+
border-top: var(--p-border-width-1) solid var(--p-color-border-subdued);
113113
margin-top: var(--p-space-5);
114114
}
115115
}
@@ -132,7 +132,7 @@
132132
+ .Subsection {
133133
margin-top: var(--p-space-4);
134134
padding-top: var(--p-space-4);
135-
border-top: var(--p-border-divider);
135+
border-top: var(--p-border-width-1) solid var(--p-color-border-subdued);
136136

137137
@media print {
138138
border-top: 0;
@@ -159,7 +159,7 @@
159159
}
160160

161161
.Section-subdued + & {
162-
border-top: var(--p-border-divider);
162+
border-top: var(--p-border-width-1) solid var(--p-color-border-subdued);
163163
padding: var(--p-space-5);
164164
}
165165
}

polaris-react/src/components/LegacyFilters/LegacyFilters.scss

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ $list-filters-footer-height: 70px;
1919
top: 0;
2020
width: 100%;
2121
padding: var(--p-space-4) var(--p-space-5);
22-
border-bottom: var(--p-border-divider);
22+
border-bottom: var(--p-border-width-1) solid var(--p-color-border-subdued);
2323
height: $list-filters-header-height;
2424
box-sizing: border-box;
2525
display: flex;
@@ -46,7 +46,7 @@ $list-filters-footer-height: 70px;
4646
bottom: 0;
4747
width: 100%;
4848
padding: var(--p-space-4) var(--p-space-5);
49-
border-top: var(--p-border-divider);
49+
border-top: var(--p-border-width-1) solid var(--p-color-border-subdued);
5050
height: $list-filters-footer-height;
5151
box-sizing: border-box;
5252
display: flex;
@@ -65,7 +65,7 @@ $list-filters-footer-height: 70px;
6565
}
6666

6767
.EmptyFooterState {
68-
border-top: var(--p-border-divider);
68+
border-top: var(--p-border-width-1) solid var(--p-color-border-subdued);
6969
padding-top: var(--p-space-4);
7070
width: 100%;
7171
display: flex;

polaris-react/src/components/Listbox/components/Option/Option.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
}
1212

1313
.divider {
14-
border-bottom: var(--p-border-divider);
14+
border-bottom: var(--p-border-width-1) solid var(--p-color-border-subdued);
1515
}

polaris-react/src/components/Listbox/components/Section/Section.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
list-style-type: none;
55
padding: 0;
66
margin: 0;
7-
border-bottom: var(--p-border-divider);
7+
border-bottom: var(--p-border-width-1) solid var(--p-color-border-subdued);
88
}
99

1010
.noDivider {

polaris-react/src/components/Modal/components/Section/Section.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ $close-button-width: calc(var(--p-space-12) + var(--p-space-1));
44
flex: 0 0 auto;
55

66
&:not(:last-of-type) {
7-
border-bottom: var(--p-border-divider);
7+
border-bottom: var(--p-border-width-1) solid var(--p-color-border-subdued);
88
}
99
}
1010

polaris-react/src/components/Navigation/Navigation.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ $nav-max-width: 360px;
1818
min-height: 100%;
1919
background-color: var(--p-color-bg-app);
2020
-webkit-overflow-scrolling: touch;
21-
border-right: var(--p-border-divider);
21+
border-right: var(--p-border-width-1) solid var(--p-color-border-subdued);
2222

2323
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
2424
@include safe-area-for(padding-bottom, 0, bottom);
@@ -484,7 +484,7 @@ $disabled-fade: 0.6;
484484
}
485485

486486
.Section-withSeparator {
487-
border-top: var(--p-border-divider);
487+
border-top: var(--p-border-width-1) solid var(--p-color-border-subdued);
488488
}
489489

490490
.SectionHeading {

polaris-react/src/components/Page/Page.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ body {
4242
}
4343

4444
.divider {
45-
border-top: var(--p-border-divider);
45+
border-top: var(--p-border-width-1) solid var(--p-color-border-subdued);
4646
padding-top: var(--p-space-8);
4747
}

polaris-react/src/components/PageActions/PageActions.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
.PageActions {
44
margin: 0 auto;
55
padding: var(--p-space-5);
6-
border-top: var(--p-border-divider);
6+
border-top: var(--p-border-width-1) solid var(--p-color-border-subdued);
77

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

polaris-react/src/components/Popover/Popover.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ $vertical-motion-offset: -5px;
8585
max-width: 100%;
8686

8787
+ .Pane {
88-
border-top: var(--p-border-divider);
88+
border-top: var(--p-border-width-1) solid var(--p-color-border-subdued);
8989
}
9090

9191
&:focus {
@@ -104,7 +104,7 @@ $vertical-motion-offset: -5px;
104104

105105
.Section {
106106
+ .Section {
107-
border-top: var(--p-border-divider);
107+
border-top: var(--p-border-width-1) solid var(--p-color-border-subdued);
108108
}
109109
}
110110

polaris-react/src/components/RangeSlider/components/SingleThumb/SingleThumb.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148
width: var(--pc-range-slider-thumb-size);
149149
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
150150
height: var(--pc-range-slider-thumb-size);
151-
border: var(--p-border-transparent);
151+
border: var(--p-border-width-1) solid transparent;
152152
border-radius: var(--p-border-radius-full);
153153
background: linear-gradient(
154154
var(--p-color-bg-interactive),

0 commit comments

Comments
 (0)