From fe3a136b896306c49607b4b0228078c6bb26fcfa Mon Sep 17 00:00:00 2001 From: Lo Kim Date: Mon, 14 Nov 2022 08:55:39 -0500 Subject: [PATCH 1/4] [ActionList] Fix top padding on sections without titles --- .../src/components/ActionList/ActionList.scss | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/polaris-react/src/components/ActionList/ActionList.scss b/polaris-react/src/components/ActionList/ActionList.scss index de120a008ef..c0779e01dbe 100644 --- a/polaris-react/src/components/ActionList/ActionList.scss +++ b/polaris-react/src/components/ActionList/ActionList.scss @@ -7,15 +7,19 @@ padding: 0; } -.Section-withoutTitle:not(:first-child) { +.Section:not(:first-child) { border-top: var(--p-border-divider); + + // stylelint-disable-next-line selector-max-class, selector-max-combinators, selector-max-specificity + > .Section-withoutTitle .Actions { + padding-top: var(--p-space-2); + } } .Actions { outline: none; list-style: none; margin: 0; - border-bottom: var(--p-border-divider); padding: var(--p-space-2); } @@ -24,7 +28,7 @@ // stylelint-disable-next-line selector-max-class, selector-max-combinators, selector-max-specificity > .Section-withoutTitle .Actions { border-top: none; - border-bottom: none; + padding-top: var(--p-space-2); } } @@ -35,13 +39,6 @@ } } -.ActionList .Section:last-child { - // stylelint-disable-next-line selector-max-class, selector-max-combinators, selector-max-specificity - .Actions { - border-bottom: none; - } -} - .Item { --pc-action-list-image-size: 20px; --pc-action-list-item-min-height: var(--p-space-10); From 2b14543d4e7841387ab8be943e1b0a411bc8c145 Mon Sep 17 00:00:00 2001 From: Lo Kim Date: Mon, 14 Nov 2022 08:55:56 -0500 Subject: [PATCH 2/4] =?UTF-8?q?TEMP=20COMMIT=20=E2=80=94=20Add=20section?= =?UTF-8?q?=20without=20titles=20storybook=20example?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ActionList/ActionList.stories.tsx | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/polaris-react/src/components/ActionList/ActionList.stories.tsx b/polaris-react/src/components/ActionList/ActionList.stories.tsx index 868926ee063..f6900faeef7 100644 --- a/polaris-react/src/components/ActionList/ActionList.stories.tsx +++ b/polaris-react/src/components/ActionList/ActionList.stories.tsx @@ -178,6 +178,47 @@ export function WithSections() { ); } +export function WithSectionsNoTitles() { + const [active, setActive] = useState(true); + + const toggleActive = useCallback(() => setActive((active) => !active), []); + + const activator = ( + + ); + + return ( +
+ + + +
+ ); +} + export function WithDestructiveItem() { const [active, setActive] = useState(true); From c26f897d24f5332966826b3359e68f177dd46f67 Mon Sep 17 00:00:00 2001 From: Lo Kim Date: Mon, 14 Nov 2022 10:58:33 -0500 Subject: [PATCH 3/4] [Modal.Header] Fix modal header spacing on smaller breakpoints --- .../src/components/Modal/components/Header/Header.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polaris-react/src/components/Modal/components/Header/Header.scss b/polaris-react/src/components/Modal/components/Header/Header.scss index 2271de2e18a..cf944a1e14e 100644 --- a/polaris-react/src/components/Modal/components/Header/Header.scss +++ b/polaris-react/src/components/Modal/components/Header/Header.scss @@ -24,5 +24,5 @@ .Title { @include text-breakword; flex: 1; - margin-top: var(--p-space-1); + align-self: center; } From b1f6f4ef9eb9b5b3e8ab2312ba45d81e36ba79cd Mon Sep 17 00:00:00 2001 From: Lo Kim Date: Mon, 14 Nov 2022 10:59:12 -0500 Subject: [PATCH 4/4] Add changeset --- .changeset/twenty-socks-count.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/twenty-socks-count.md diff --git a/.changeset/twenty-socks-count.md b/.changeset/twenty-socks-count.md new file mode 100644 index 00000000000..79aca2d5f66 --- /dev/null +++ b/.changeset/twenty-socks-count.md @@ -0,0 +1,5 @@ +--- +'@shopify/polaris': patch +--- + +Fixed visual spacing regressions on `ActionList` and `Modal.Header`