Skip to content

Commit 2acfc0f

Browse files
authored
[patterns] add dividers and tighten spacing on app-settings-layout-example (#8625)
### WHY are these changes introduced? App settings layout pattern wasn't conforming with designs or layout usage. This PR resolves this. ### WHAT is this pull request doing? * Adds a divider between each settings group. * Reduce gap from 16 to 4 for `sm` breakpoint and above. * Reduce gap from 16 to 8 for `xs` breakpoint and above. ### How to 🎩 🖥 [Local development instructions](https://github.com/Shopify/polaris/blob/main/README.md#local-development) 🗒 [General tophatting guidelines](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md) 📄 [Changelog guidelines](https://github.com/Shopify/polaris/blob/main/.github/CONTRIBUTING.md#changelog) <!-- Give as much information as needed to experiment with the component in the playground. --> <details> <summary>Copy-paste this code in <code>playground/Playground.tsx</code>:</summary> ```jsx import React from 'react'; import {Page} from '../src'; export function Playground() { return ( <Page title="Playground"> {/* Add the code you want to test in here */} </Page> ); } ``` </details> ### 🎩 checklist - [ ] Tested on [mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing) - [ ] Tested on [multiple browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers) - [ ] Tested for [accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md) - [ ] Updated the component's `README.md` with documentation changes - [ ] [Tophatted documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md) changes in the style guide
1 parent 613f637 commit 2acfc0f

File tree

1 file changed

+65
-59
lines changed
  • polaris.shopify.com/content/patterns/app-settings-layout/variants

1 file changed

+65
-59
lines changed

polaris.shopify.com/content/patterns/app-settings-layout/variants/default.md

Lines changed: 65 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -29,69 +29,75 @@ This pattern uses the [`AlphaStack`](/components/layout-and-structure/alpha-stac
2929
<!-- prettier-ignore -->
3030
```javascript {"type":"previewContext","for":"example"}
3131
<div style={{ paddingBottom: '2rem' }}>
32-
____CODE____
32+
{(____CODE____)()}
3333
</div>
3434
```
3535

3636
```javascript {"type":"livePreview","id":"example"}
37-
<Page
38-
divider
39-
primaryAction={{content: 'View on your store', disabled: true}}
40-
secondaryActions={[
41-
{
42-
content: 'Duplicate',
43-
accessibilityLabel: 'Secondary action label',
44-
onAction: () => alert('Duplicate action'),
45-
},
46-
]}
47-
>
48-
<AlphaStack gap="16" align="center">
49-
<Columns columns={{xs: '1fr', md: '2fr 5fr'}} gap="4">
50-
<Box
51-
as="section"
52-
paddingInlineStart={{xs: 4, sm: 0}}
53-
paddingInlineEnd={{xs: 4, sm: 0}}
54-
>
55-
<AlphaStack gap="4">
56-
<Text as="h3" variant="headingMd">
57-
InterJambs
58-
</Text>
59-
<Text as="p" variant="bodyMd">
60-
Interjambs are the rounded protruding bits of your puzzlie piece
61-
</Text>
62-
</AlphaStack>
63-
</Box>
64-
<AlphaCard roundedAbove="sm">
65-
<AlphaStack gap="4">
66-
<TextField label="Interjamb style" />
67-
<TextField label="Interjamb ratio" />
68-
</AlphaStack>
69-
</AlphaCard>
70-
</Columns>
71-
<Columns columns={{xs: '1fr', md: '2fr 5fr'}} gap="4">
72-
<Box
73-
as="section"
74-
paddingInlineStart={{xs: 4, sm: 0}}
75-
paddingInlineEnd={{xs: 4, sm: 0}}
76-
>
77-
<AlphaStack gap="4">
78-
<Text as="h3" variant="headingMd">
79-
Dimensions
80-
</Text>
81-
<Text as="p" variant="bodyMd">
82-
Interjambs are the rounded protruding bits of your puzzlie piece
83-
</Text>
84-
</AlphaStack>
85-
</Box>
86-
<AlphaCard roundedAbove="sm">
87-
<AlphaStack gap="4">
88-
<TextField label="Horizontal" />
89-
<TextField label="Interjamb ratio" />
90-
</AlphaStack>
91-
</AlphaCard>
92-
</Columns>
93-
</AlphaStack>
94-
</Page>
37+
function AppSettingsLayoutExample() {
38+
const {smUp} = useBreakpoints();
39+
return (
40+
<Page
41+
divider
42+
primaryAction={{content: 'View on your store', disabled: true}}
43+
secondaryActions={[
44+
{
45+
content: 'Duplicate',
46+
accessibilityLabel: 'Secondary action label',
47+
onAction: () => alert('Duplicate action'),
48+
},
49+
]}
50+
>
51+
<AlphaStack gap={{xs: '8', sm: '4'}}>
52+
<Columns columns={{xs: '1fr', md: '2fr 5fr'}} gap="4">
53+
<Box
54+
as="section"
55+
paddingInlineStart={{xs: 4, sm: 0}}
56+
paddingInlineEnd={{xs: 4, sm: 0}}
57+
>
58+
<AlphaStack gap="4">
59+
<Text as="h3" variant="headingMd">
60+
InterJambs
61+
</Text>
62+
<Text as="p" variant="bodyMd">
63+
Interjambs are the rounded protruding bits of your puzzlie piece
64+
</Text>
65+
</AlphaStack>
66+
</Box>
67+
<AlphaCard roundedAbove="sm">
68+
<AlphaStack gap="4">
69+
<TextField label="Interjamb style" />
70+
<TextField label="Interjamb ratio" />
71+
</AlphaStack>
72+
</AlphaCard>
73+
</Columns>
74+
{smUp ? <Divider borderStyle="base" /> : null}
75+
<Columns columns={{xs: '1fr', md: '2fr 5fr'}} gap="4">
76+
<Box
77+
as="section"
78+
paddingInlineStart={{xs: 4, sm: 0}}
79+
paddingInlineEnd={{xs: 4, sm: 0}}
80+
>
81+
<AlphaStack gap="4">
82+
<Text as="h3" variant="headingMd">
83+
Dimensions
84+
</Text>
85+
<Text as="p" variant="bodyMd">
86+
Interjambs are the rounded protruding bits of your puzzlie piece
87+
</Text>
88+
</AlphaStack>
89+
</Box>
90+
<AlphaCard roundedAbove="sm">
91+
<AlphaStack gap="4">
92+
<TextField label="Horizontal" />
93+
<TextField label="Interjamb ratio" />
94+
</AlphaStack>
95+
</AlphaCard>
96+
</Columns>
97+
</AlphaStack>
98+
</Page>
99+
);
100+
}
95101
```
96102

97103
</div>

0 commit comments

Comments
 (0)