Skip to content

Commit f5e4503

Browse files
authored
[Layout] Bleed remove default spacing (#8470)
### WHY are these changes introduced? Fixes #8367 ### WHAT is this pull request doing? Removes the default negative horizontal margin from the `Bleed` component
1 parent 3537b3a commit f5e4503

File tree

7 files changed

+636
-653
lines changed

7 files changed

+636
-653
lines changed

.changeset/new-tools-flow.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+
Removed default margin from `Bleed`

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export function WithSubduedSection() {
8888
</List>
8989
</Box>
9090
</AlphaStack>
91-
<Bleed marginBlockEnd="5">
91+
<Bleed marginBlockEnd="5" marginInline="5">
9292
<Divider />
9393
<Box
9494
background="surface-subdued"

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ type Spacing = ResponsiveProp<SpacingSpaceScale>;
1313

1414
export interface BleedProps {
1515
children?: React.ReactNode;
16-
/** Negative horizontal space around children
17-
* @default '5'
18-
*/
16+
/** Negative horizontal space around children */
1917
marginInline?: Spacing;
2018
/** Negative vertical space around children */
2119
marginBlock?: Spacing;
@@ -30,7 +28,7 @@ export interface BleedProps {
3028
}
3129

3230
export const Bleed = ({
33-
marginInline = '5',
31+
marginInline,
3432
marginBlock,
3533
marginBlockStart,
3634
marginBlockEnd,

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

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,6 @@ describe('<Bleed />', () => {
1616
expect(bleed).toContainReactComponent(Children);
1717
});
1818

19-
it('renders default horizontal custom properties', () => {
20-
const bleed = mountWithApp(
21-
<Bleed>
22-
<Children />
23-
</Bleed>,
24-
);
25-
26-
expect(bleed).toContainReactComponent('div', {
27-
style: {
28-
'--pc-bleed-margin-inline-start-xs': 'var(--p-space-5)',
29-
'--pc-bleed-margin-inline-end-xs': 'var(--p-space-5)',
30-
} as React.CSSProperties,
31-
});
32-
});
33-
3419
it('only renders the custom property that matches the property passed in', () => {
3520
const bleed = mountWithApp(
3621
<Bleed marginInlineStart="2">
@@ -41,7 +26,6 @@ describe('<Bleed />', () => {
4126
expect(bleed).toContainReactComponent('div', {
4227
style: {
4328
'--pc-bleed-margin-inline-start-xs': 'var(--p-space-2)',
44-
'--pc-bleed-margin-inline-end-xs': 'var(--p-space-5)',
4529
} as React.CSSProperties,
4630
});
4731
});

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,7 @@ export function ChoiceList({
108108
) : null;
109109
return (
110110
<li key={value}>
111-
<Bleed
112-
marginInline="0"
113-
marginBlockEnd={helpText ? {xs: '1', md: '0'} : {xs: '0'}}
114-
>
111+
<Bleed marginBlockEnd={helpText ? {xs: '1', md: '0'} : {xs: '0'}}>
115112
<ControlComponent
116113
name={finalName}
117114
value={value}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export function OptionList({
136136
paddingBlockStart={isFirstOption ? undefined : '2'}
137137
>
138138
{titleMarkup}
139-
<Bleed marginBlockStart={title ? undefined : '05'} marginInline="0">
139+
<Bleed marginBlockStart={title ? undefined : '05'}>
140140
<Box
141141
as="ul"
142142
id={`${id}-${sectionIndex}`}

0 commit comments

Comments
 (0)