From a94ea3a23d0350b30928799db95d54bb4db9527b Mon Sep 17 00:00:00 2001 From: Laura Griffee Date: Mon, 29 Apr 2024 15:12:06 -0600 Subject: [PATCH 1/3] Update `Banner` mobile styles --- .changeset/grumpy-cheetahs-hug.md | 5 +++ .../src/components/Banner/Banner.module.css | 2 - .../src/components/Banner/Banner.stories.tsx | 4 +- .../src/components/Banner/Banner.tsx | 43 ++++++++++++++++--- .../components/Banner/tests/Banner.test.tsx | 4 +- .../src/components/Banner/utilities.ts | 4 +- 6 files changed, 49 insertions(+), 13 deletions(-) create mode 100644 .changeset/grumpy-cheetahs-hug.md diff --git a/.changeset/grumpy-cheetahs-hug.md b/.changeset/grumpy-cheetahs-hug.md new file mode 100644 index 00000000000..cb2d0345f3e --- /dev/null +++ b/.changeset/grumpy-cheetahs-hug.md @@ -0,0 +1,5 @@ +--- +'@shopify/polaris': minor +--- + +Updated `Banner` styling for small screens diff --git a/polaris-react/src/components/Banner/Banner.module.css b/polaris-react/src/components/Banner/Banner.module.css index e30f8efbc62..80878f82382 100644 --- a/polaris-react/src/components/Banner/Banner.module.css +++ b/polaris-react/src/components/Banner/Banner.module.css @@ -21,8 +21,6 @@ } .withinPage { - @mixin shadow-bevel var(--p-shadow-200), var(--p-border-radius-0); - @media (--p-breakpoints-sm-up) { @mixin shadow-bevel var(--p-shadow-200), var(--p-border-radius-300); } diff --git a/polaris-react/src/components/Banner/Banner.stories.tsx b/polaris-react/src/components/Banner/Banner.stories.tsx index b306594fe73..7666839bf8f 100644 --- a/polaris-react/src/components/Banner/Banner.stories.tsx +++ b/polaris-react/src/components/Banner/Banner.stories.tsx @@ -299,8 +299,8 @@ export const All = { {}} - action={{content: 'Primary action'}} - secondaryAction={{content: 'Secondary action'}} + action={{content: 'Primary'}} + secondaryAction={{content: 'Secondary'}} /> Default by status diff --git a/polaris-react/src/components/Banner/Banner.tsx b/polaris-react/src/components/Banner/Banner.tsx index a46ab9e2b9c..366f71c26f7 100644 --- a/polaris-react/src/components/Banner/Banner.tsx +++ b/polaris-react/src/components/Banner/Banner.tsx @@ -108,6 +108,7 @@ export function BannerLayout({ children, }: BannerProps) { const i18n = useI18n(); + const {smUp} = useBreakpoints(); const withinContentContainer = useContext(WithinContentContext); const isInlineIconBanner = !title && !withinContentContainer; const bannerTone = Object.keys(bannerAttributes).includes(tone) @@ -133,7 +134,7 @@ export function BannerLayout({ ), actionButtons: action || secondaryAction ? ( - + {action && (