Skip to content

Commit d08e1c3

Browse files
authored
[Bleed] Remove spacing prop (#7732)
Fixes: #7735 The spacing prop name is confusing and can be achieved with a combination of either specifying `top, right, bottom ,left` or `horizontal, vertical`. Removing it simplifies the component and documentation and aligns with our naming conventions
1 parent b7b7292 commit d08e1c3

File tree

6 files changed

+1236
-1215
lines changed

6 files changed

+1236
-1215
lines changed

.changeset/tricky-apes-vanish.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+
Removed `spacing` prop from Bleed component

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export function WithSpecificDirection() {
6464
export function WithAllDirection() {
6565
return (
6666
<Box background="surface" padding="4">
67-
<Bleed spacing="6">
67+
<Bleed horizontal="6" vertical="6">
6868
<div style={styles} />
6969
</Bleed>
7070
</Box>

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ import styles from './Bleed.scss';
88
export interface BleedProps {
99
/** Elements to display inside tile */
1010
children: React.ReactNode;
11-
/** Negative space around the element */
12-
spacing?: SpacingSpaceScale;
1311
/** Negative horizontal space around the element
1412
* * @default '5'
1513
*/
@@ -27,7 +25,6 @@ export interface BleedProps {
2725
}
2826

2927
export const Bleed = ({
30-
spacing,
3128
horizontal = '5',
3229
vertical,
3330
top,
@@ -55,8 +52,6 @@ export const Bleed = ({
5552
return directionValues.horizontal;
5653
} else if (!xAxis.includes(direction) && vertical) {
5754
return directionValues.vertical;
58-
} else {
59-
return spacing;
6055
}
6156
};
6257

polaris-react/src/components/Bleed/tests/Bleed.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ describe('<Bleed />', () => {
4848

4949
it('renders custom properties combined with any overrides if they are passed in', () => {
5050
const bleed = mountWithApp(
51-
<Bleed spacing="1" left="2" horizontal="3">
51+
<Bleed vertical="1" left="2" horizontal="3">
5252
<Children />
5353
</Bleed>,
5454
);

polaris.shopify.com/pages/examples/bleed-all-directions.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {withPolarisExample} from '../../src/components/PolarisExampleWrapper';
66
function BleedAllDirectionsExample() {
77
return (
88
<Box background="surface" border="base" padding="4">
9-
<Bleed spacing="4">
9+
<Bleed vertical="4" horizontal="4">
1010
<Placeholder label="All directions" />
1111
</Bleed>
1212
</Box>

0 commit comments

Comments
 (0)