Skip to content

Commit f9e1985

Browse files
authored
Fix typo in responsive-props mixin (#7757)
### WHY are these changes introduced? - Fixes a typo in the `responsive-props` mixin - Add examples for responsive spacing in `Box`
1 parent 81f3793 commit f9e1985

File tree

4 files changed

+1972
-1946
lines changed

4 files changed

+1972
-1946
lines changed

.changeset/new-birds-pretend.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@shopify/polaris': patch
3+
'polaris.shopify.com': patch
4+
---
5+
6+
Fixed typo in `responsive-props` mixin. Added jsdoc examples for responsive spacing props in `Box`.

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

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,15 +138,35 @@ export interface BoxProps {
138138
overflowX?: Overflow;
139139
/** Clip vertical content of children */
140140
overflowY?: Overflow;
141-
/** Spacing around children */
141+
/** Spacing around children. Accepts a spacing token or an object of spacing tokens for different screen sizes.
142+
* @example
143+
* padding='4'
144+
* padding={{xs: '2', sm: '3', md: '4', lg: '5', xl: '6'}}
145+
*/
142146
padding?: Spacing;
143-
/** Vertical start spacing around children */
147+
/** Vertical start spacing around children. Accepts a spacing token or an object of spacing tokens for different screen sizes.
148+
* @example
149+
* paddingBlockStart='4'
150+
* paddingBlockStart={{xs: '2', sm: '3', md: '4', lg: '5', xl: '6'}}
151+
*/
144152
paddingBlockStart?: Spacing;
145-
/** Vertical end spacing around children */
153+
/** Vertical end spacing around children. Accepts a spacing token or an object of spacing tokens for different screen sizes.
154+
* @example
155+
* paddingBlockEnd='4'
156+
* paddingBlockEnd={{xs: '2', sm: '3', md: '4', lg: '5', xl: '6'}}
157+
*/
146158
paddingBlockEnd?: Spacing;
147-
/** Horizontal start spacing around children */
159+
/** Horizontal start spacing around children. Accepts a spacing token or an object of spacing tokens for different screen sizes.
160+
* @example
161+
* paddingInlineStart='4'
162+
* paddingInlineStart={{xs: '2', sm: '3', md: '4', lg: '5', xl: '6'}}
163+
*/
148164
paddingInlineStart?: Spacing;
149-
/** Horizontal end spacing around children */
165+
/** Horizontal end spacing around children. Accepts a spacing token or an object of spacing tokens for different screen sizes.
166+
* @example
167+
* paddingInlineEnd='4'
168+
* paddingInlineEnd={{xs: '2', sm: '3', md: '4', lg: '5', xl: '6'}}
169+
*/
150170
paddingInlineEnd?: Spacing;
151171
/** Shadow */
152172
shadow?: DepthShadowAlias;
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@mixin responsive-props(
22
$componentName,
33
$componentProp,
4-
$declartionProp,
4+
$declarationProp,
55
$shorthandFallback: null
66
) {
77
--pc-#{$componentName}-#{$componentProp}-xs: initial;
@@ -18,55 +18,55 @@
1818
--pc-#{$componentName}-#{$componentProp}-lg
1919
);
2020
@if $shorthandFallback {
21-
#{$declartionProp}: var(
21+
#{$declarationProp}: var(
2222
--pc-#{$componentName}-#{$componentProp}-xs,
2323
var(--pc-#{$componentName}-#{$shorthandFallback}-xs)
2424
);
2525

2626
@media #{$p-breakpoints-sm-up} {
27-
#{$declartionProp}: var(
27+
#{$declarationProp}: var(
2828
--pc-#{$componentName}-#{$componentProp}-sm,
2929
var(--pc-#{$componentName}-#{$shorthandFallback}-sm)
3030
);
3131
}
3232

3333
@media #{$p-breakpoints-md-up} {
34-
#{$declartionProp}: var(
34+
#{$declarationProp}: var(
3535
--pc-#{$componentName}-#{$componentProp}-md,
3636
var(--pc-#{$componentName}-#{$shorthandFallback}-md)
3737
);
3838
}
3939

4040
@media #{$p-breakpoints-lg-up} {
41-
#{$declartionProp}: var(
41+
#{$declarationProp}: var(
4242
--pc-#{$componentName}-#{$componentProp}-lg,
4343
var(--pc-#{$componentName}-#{$shorthandFallback}-lg)
4444
);
4545
}
4646

4747
@media #{$p-breakpoints-xl-up} {
48-
#{$declartionProp}: var(
48+
#{$declarationProp}: var(
4949
--pc-#{$componentName}-#{$componentProp}-xl,
5050
var(--pc-#{$componentName}-#{$shorthandFallback}-xl)
5151
);
5252
}
5353
} @else {
54-
#{$declartionProp}: var(--pc-#{$componentName}-#{$componentProp}-xs);
54+
#{$declarationProp}: var(--pc-#{$componentName}-#{$componentProp}-xs);
5555

5656
@media #{$p-breakpoints-sm-up} {
57-
#{$declartionProp}: var(--pc-#{$componentName}-#{$componentProp}-sm);
57+
#{$declarationProp}: var(--pc-#{$componentName}-#{$componentProp}-sm);
5858
}
5959

6060
@media #{$p-breakpoints-md-up} {
61-
#{$declartionProp}: var(--pc-#{$componentName}-#{$componentProp}-md);
61+
#{$declarationProp}: var(--pc-#{$componentName}-#{$componentProp}-md);
6262
}
6363

6464
@media #{$p-breakpoints-lg-up} {
65-
#{$declartionProp}: var(--pc-#{$componentName}-#{$componentProp}-lg);
65+
#{$declarationProp}: var(--pc-#{$componentName}-#{$componentProp}-lg);
6666
}
6767

6868
@media #{$p-breakpoints-xl-up} {
69-
#{$declartionProp}: var(--pc-#{$componentName}-#{$componentProp}-xl);
69+
#{$declarationProp}: var(--pc-#{$componentName}-#{$componentProp}-xl);
7070
}
7171
}
7272
}

0 commit comments

Comments
 (0)