From 68e53a4ef137420ca2a9b72f3aaa1899f01ec7ec Mon Sep 17 00:00:00 2001 From: Lea Verou Date: Thu, 19 Dec 2024 12:39:56 -0500 Subject: [PATCH] Automatic util listing on sidebar --- docs/_includes/sidebar.njk | 46 ++++++++++++++----------- docs/docs/components/components.json | 3 +- docs/docs/components/page.md | 2 +- docs/docs/components/visually-hidden.md | 1 + docs/docs/utilities/utilities.json | 3 +- 5 files changed, 32 insertions(+), 23 deletions(-) diff --git a/docs/_includes/sidebar.njk b/docs/_includes/sidebar.njk index a41606e38..c4e00787d 100644 --- a/docs/_includes/sidebar.njk +++ b/docs/_includes/sidebar.njk @@ -58,30 +58,47 @@ + + + +

+ Style utilities + + +

+
{# Layout #} -{% if not isAlpha %}

Layout

-{% endif %} {# Patterns #} {% if not isAlpha %} @@ -137,14 +154,3 @@ Component Groups - -{# Style Utilities #} -{% if not isAlpha %} -

Style Utilities

- -{% endif %} diff --git a/docs/docs/components/components.json b/docs/docs/components/components.json index 09bdf2af9..b6a308a6c 100644 --- a/docs/docs/components/components.json +++ b/docs/docs/components/components.json @@ -1,3 +1,4 @@ { - "layout": "component.njk" + "layout": "component.njk", + "tags": ["components"] } diff --git a/docs/docs/components/page.md b/docs/docs/components/page.md index bcb8d2f77..21afd37b5 100644 --- a/docs/docs/components/page.md +++ b/docs/docs/components/page.md @@ -1,7 +1,7 @@ --- title: Page description: Pages offer an easy way to scaffold entire page layouts using minimal markup. -tags: component +tags: ["component", "layout"] isPro: true order: 1 --- diff --git a/docs/docs/components/visually-hidden.md b/docs/docs/components/visually-hidden.md index 851fd0bd6..4542c6b89 100644 --- a/docs/docs/components/visually-hidden.md +++ b/docs/docs/components/visually-hidden.md @@ -2,6 +2,7 @@ title: Visually Hidden description: The visually hidden utility makes content accessible to assistive devices without displaying it on the screen. tags: component +noAlpha: true --- According to [The A11Y Project](https://www.a11yproject.com/posts/2013-01-11-how-to-hide-content/), "there are real world situations where visually hiding content may be appropriate, while the content should remain available to assistive technologies, such as screen readers. For instance, hiding a search field's label as a common magnifying glass icon is used in its stead." diff --git a/docs/docs/utilities/utilities.json b/docs/docs/utilities/utilities.json index 72c8a991b..af7dbba50 100644 --- a/docs/docs/utilities/utilities.json +++ b/docs/docs/utilities/utilities.json @@ -1,3 +1,4 @@ { - "layout": "page-outline" + "layout": "page-outline", + "tags": ["utilities"] }