From 64120116a8f70dc5a9be4f239caae87f4be29a1f Mon Sep 17 00:00:00 2001 From: Cristiano Rastelli Date: Tue, 29 Oct 2024 11:10:43 +0000 Subject: [PATCH 1/2] made the `gap` argument optional in the `Shw::Grid` signature --- showcase/app/components/shw/grid/index.gts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/showcase/app/components/shw/grid/index.gts b/showcase/app/components/shw/grid/index.gts index a882a57648..7dfe7cf82c 100644 --- a/showcase/app/components/shw/grid/index.gts +++ b/showcase/app/components/shw/grid/index.gts @@ -20,7 +20,7 @@ interface ShwGridSignature { Args: { columns: 2 | 3 | 4 | 5 | 6 | 7; forceMinWidth?: boolean; - gap: string; + gap?: string; grow?: boolean; label?: string; }; From d42a1f3fdae25ca4a2ea6e6c6f2a6f799f6ae595 Mon Sep 17 00:00:00 2001 From: Cristiano Rastelli Date: Tue, 29 Oct 2024 11:13:31 +0000 Subject: [PATCH 2/2] added support for 1-column layout in `Shw::Grid` component --- showcase/app/components/shw/grid/index.gts | 2 +- showcase/app/styles/showcase-components/grid.scss | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/showcase/app/components/shw/grid/index.gts b/showcase/app/components/shw/grid/index.gts index 7dfe7cf82c..be627d411f 100644 --- a/showcase/app/components/shw/grid/index.gts +++ b/showcase/app/components/shw/grid/index.gts @@ -18,7 +18,7 @@ import type { ShwGridItemSignature } from './item'; interface ShwGridSignature { Args: { - columns: 2 | 3 | 4 | 5 | 6 | 7; + columns: 1 | 2 | 3 | 4 | 5 | 6 | 7; forceMinWidth?: boolean; gap?: string; grow?: boolean; diff --git a/showcase/app/styles/showcase-components/grid.scss b/showcase/app/styles/showcase-components/grid.scss index a54850bcc4..047c760379 100644 --- a/showcase/app/styles/showcase-components/grid.scss +++ b/showcase/app/styles/showcase-components/grid.scss @@ -17,6 +17,10 @@ flex-wrap: wrap; gap: var(--shw-layout-gap-base); + .shw-grid--cols-1 > & { + grid-template-columns: 1fr; + } + .shw-grid--cols-2 > & { grid-template-columns: repeat(2, 1fr); }