From a9dc16625d25d45c0ae99ca28e8f22b3e0b63f43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20D=C3=A9ramond?= Date: Wed, 7 Aug 2024 08:12:12 +0200 Subject: [PATCH 1/2] docs(helpers): add 'Stacks' page --- site/content/docs/0.0/helpers/stacks.md | 85 ++++++++++++++++++++++++- site/data/sidebar.yml | 1 - 2 files changed, 84 insertions(+), 2 deletions(-) diff --git a/site/content/docs/0.0/helpers/stacks.md b/site/content/docs/0.0/helpers/stacks.md index 834fc7390c..d80d4cbe9b 100644 --- a/site/content/docs/0.0/helpers/stacks.md +++ b/site/content/docs/0.0/helpers/stacks.md @@ -8,4 +8,87 @@ aliases: toc: true --- -{{< callout-soon "helper" >}} +Stacks offer a shortcut for applying a number of flexbox properties to quickly and easily create layouts in OUDS Web. All credit for the concept and implementation goes to the open source [Pylon project](https://almonk.github.io/pylon/). + +{{< callout warning >}} +**Heads up!** Support for gap utilities with flexbox was recently added to Safari, so consider verifying your intended browser support. Grid layout should have no issues. [Read more](https://caniuse.com/flexbox-gap). +{{< /callout >}} + +## Vertical + +Use `.vstack` to create vertical layouts. Stacked items are full-width by default. Use `.gap-*` utilities to add space between items. + +{{< example class="bd-example-flex" >}} +
+
First item
+
Second item
+
Third item
+
+{{< /example >}} + +## Horizontal + +Use `.hstack` for horizontal layouts. Stacked items are vertically centered by default and only take up their necessary width. Use `.gap-*` utilities to add space between items. + +{{< example class="bd-example-flex" >}} +
+
First item
+
Second item
+
Third item
+
+{{< /example >}} + +Using horizontal margin utilities like `.ms-auto` as spacers: + +{{< example class="bd-example-flex" >}} +
+
First item
+
Second item
+
Third item
+
+{{< /example >}} + + + + + +## CSS + +{{< scss-docs name="stacks" file="scss/helpers/_stacks.scss" >}} diff --git a/site/data/sidebar.yml b/site/data/sidebar.yml index faa6c29e63..d7c1203e64 100644 --- a/site/data/sidebar.yml +++ b/site/data/sidebar.yml @@ -196,7 +196,6 @@ - title: Ratio draft: true - title: Stacks - draft: true - title: Stretched link draft: true - title: Text truncation From 184b2079a17b5758352103f514e53d0d2aad98e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20D=C3=A9ramond?= Date: Wed, 7 Aug 2024 09:58:27 +0200 Subject: [PATCH 2/2] . --- site/content/docs/0.0/helpers/stacks.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/site/content/docs/0.0/helpers/stacks.md b/site/content/docs/0.0/helpers/stacks.md index d80d4cbe9b..1f10034a5e 100644 --- a/site/content/docs/0.0/helpers/stacks.md +++ b/site/content/docs/0.0/helpers/stacks.md @@ -73,10 +73,10 @@ Use `.vstack` to stack buttons and other elements: Create an inline form with `.hstack`:
-See Bootstrap examples that are incompatible with Orange Design System. +See Bootstrap examples that are incompatible with Orange Unified Design System.
{{< design-callout-alert >}} -This variant with an **horizontal layout** (i.e. labels not above the input fields) should not be used because it does not respect the Orange Design System specifications. +This variant with an **horizontal layout** (i.e. labels not above the input fields) should not be used because it does not respect the Orange Unified Design System specifications. {{< /design-callout-alert >}} {{< example >}}