Skip to content

Commit 63a9030

Browse files
committed
Ensure non-responsive React props are properly encapsulated when converted to CSS Custom Properties
1 parent b0521a4 commit 63a9030

File tree

8 files changed

+33
-7
lines changed

8 files changed

+33
-7
lines changed

.changeset/cyan-hats-jam.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@shopify/polaris': patch
3+
---
4+
5+
Correctly scope CSS Variables for non-responsive props on `Tooltip`, `RangeSlider`, `ProgressBar`, and `HorizontalStack`.

.changeset/slimy-donuts-report.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@shopify/polaris': minor
3+
---
4+
5+
Add support for non-responsive values to `Grid`'s `gap`, `columns`, and `areas` props.
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
@import '../../styles/common';
22

33
.HorizontalStack {
4-
@include responsive-props('horizontal-stack', 'gap', 'gap');
54
display: flex;
6-
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
7-
flex-wrap: var(--pc-horizontal-stack-wrap);
8-
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
9-
align-items: var(--pc-horizontal-stack-block-align);
10-
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
11-
justify-content: var(--pc-horizontal-stack-align);
5+
@include responsive-props('horizontal-stack', 'gap', 'gap');
6+
@include non-responsive-prop('horizontal-stack', 'wrap', 'flex-wrap');
7+
@include non-responsive-prop(
8+
'horizontal-stack',
9+
'block-align',
10+
'align-items'
11+
);
12+
@include non-responsive-prop('horizontal-stack', 'align', 'justify-content');
1213
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
}
1313

1414
.ProgressBar {
15+
@include scope-custom-property('progress-bar', 'duration');
16+
@include scope-custom-property('progress-bar', 'percent');
1517
overflow: hidden;
1618
width: 100%;
1719
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ $range-wrapper: 28px;
2525
}
2626

2727
.Track {
28+
@include scope-custom-property('range-slider', 'progress-upper');
29+
@include scope-custom-property('range-slider', 'progress-lower');
2830
// stylelint-disable -- Polaris component custom properties
2931
--pc-dual-thumb-unselected-range: transparent;
3032
--pc-dual-thumb-selected-range: var(--p-color-bg-interactive);

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@
7979
}
8080

8181
.Input {
82+
@include scope-custom-property('range-slider', 'min');
83+
@include scope-custom-property('range-slider', 'max');
84+
@include scope-custom-property('range-slider', 'current');
85+
@include scope-custom-property('range-slider', 'progess');
86+
@include scope-custom-property('range-slider', 'output-factor');
8287
// stylelint-disable -- Polaris component custom properties
8388
--pc-single-thumb-progress-lower: var(--p-color-bg-interactive);
8489
--pc-single-thumb-progress-upper: transparent;

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
// stylelint-disable-next-line -- Explicitly set `0` to create a local stacking context. While the initial `z-index: auto` has a stack level of `0` within the current stacking context, it does not create a new local stacking context.
66
z-index: 0;
77

8+
@include scope-custom-property('shadow-bevel', 'z-index');
9+
810
@include responsive-props(
911
$componentName: 'shadow-bevel',
1012
$componentProp: 'box-shadow',

polaris-react/src/components/Tooltip/components/TooltipOverlay/TooltipOverlay.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
@import '../../../../styles/common';
22

33
.TooltipOverlay {
4+
@include scope-custom-property('tooltip', 'chevron-x-pos');
5+
@include scope-custom-property('tooltip', 'border-radius');
6+
@include scope-custom-property('tooltip', 'padding');
7+
48
// stylelint-disable -- Polaris component custom properties
59
--pc-tooltip-overlay-offset: var(--p-space-3);
610
--pc-tooltip-shadow-bevel-z-index: 1;

0 commit comments

Comments
 (0)