Skip to content

Commit 2a0e489

Browse files
committed
chore(docs): apply lint and format updates
1 parent f8f129a commit 2a0e489

40 files changed

Lines changed: 10582 additions & 10330 deletions

packages/stacks-docs/CLAUDE.md

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ This is the SvelteKit documentation site for the Stacks v3 design system. Pages
99
```yaml
1010
---
1111
title: "Page Title"
12-
description: "" # shown in the page header and meta
13-
figma: "https://…" # optional — links to Figma file
14-
svelte: "https://…" # optional — links to stacks-svelte component
15-
js: true # only if the page has a JavaScript section
16-
updated: 2026-01-15 # ISO date of last meaningful content update
12+
description: "" # shown in the page header and meta
13+
figma: "https://…" # optional — links to Figma file
14+
svelte: "https://…" # optional — links to stacks-svelte component
15+
js: true # only if the page has a JavaScript section
16+
updated: 2026-01-15 # ISO date of last meaningful content update
1717
---
1818
```
1919

@@ -47,17 +47,17 @@ Use standard markdown for prose. Svelte components can be used anywhere in the b
4747
4848
## Available doc components
4949
50-
| Component | Location | Purpose |
51-
|---|---|---|
52-
| `ClassTable` | `$components/ClassTable.svelte` | CSS class / JS attribute reference tables |
53-
| `Example` | `$components/Example.svelte` | Bordered container for static example content |
54-
| `Grid` | `$components/Grid.svelte` | Equal-width responsive column grid for Do/Don't blocks |
55-
| `GridColumn` | `$components/GridColumn.svelte` | Column within a `Grid`; accepts `extraClasses`, `padding` prop |
56-
| `PreviewTable` | `$components/PreviewTable.svelte` | Table of component previews: Example \| Class \| Description |
57-
| `BannerPreview` | `$components/BannerPreview.svelte` | Static pre-built banner instance for illustration |
58-
| `BannerDemo` | `$components/BannerDemo.svelte` | Interactive banner playground with user controls |
59-
| `StacksEditorDemo` | `$components/StacksEditorDemo.svelte` | Interactive Stacks editor playground |
60-
| `TableSortDemo` | `$components/TableSortDemo.svelte` | Interactive sortable table playground |
50+
| Component | Location | Purpose |
51+
| ------------------ | ------------------------------------- | -------------------------------------------------------------- |
52+
| `ClassTable` | `$components/ClassTable.svelte` | CSS class / JS attribute reference tables |
53+
| `Example` | `$components/Example.svelte` | Bordered container for static example content |
54+
| `Grid` | `$components/Grid.svelte` | Equal-width responsive column grid for Do/Don't blocks |
55+
| `GridColumn` | `$components/GridColumn.svelte` | Column within a `Grid`; accepts `extraClasses`, `padding` prop |
56+
| `PreviewTable` | `$components/PreviewTable.svelte` | Table of component previews: Example \| Class \| Description |
57+
| `BannerPreview` | `$components/BannerPreview.svelte` | Static pre-built banner instance for illustration |
58+
| `BannerDemo` | `$components/BannerDemo.svelte` | Interactive banner playground with user controls |
59+
| `StacksEditorDemo` | `$components/StacksEditorDemo.svelte` | Interactive Stacks editor playground |
60+
| `TableSortDemo` | `$components/TableSortDemo.svelte` | Interactive sortable table playground |
6161

6262
**Naming convention:** `Example` = generic wrapper; `*Preview` = static pre-built component instance; `*Demo` = interactive playground with user controls.
6363

@@ -74,6 +74,7 @@ Use `ClassTable` for every reference table — never raw markdown tables.
7474
```
7575

7676
**ClassTableRow fields:** `class`, `parent`, `modifies`, `output`, `description`, `define`, `responsive`.
77+
7778
- Only populate relevant fields — `ClassTable` auto-hides columns with no data.
7879
- Use `'N/A'` (string) for explicitly empty `parent`/`modifies` — renders as muted text.
7980
- The `headings` prop renames any column: `headings={{ class: 'Selector', description: 'Notes' }}`.
@@ -111,6 +112,7 @@ Sub-example labels always use `class="ff-mono mb8"`.
111112
```
112113

113114
`GridColumn` props:
115+
114116
- `extraClasses` — appended to the column div (default: `bg-black-200`)
115117
- `padding` — adds `p24` when `true` (default: `true`); set `false` if you're applying `py*` in `extraClasses` to avoid conflict
116118
- `...rest` — any extra attributes (e.g. `style="background: var(--brand-color-orange)"`) are spread onto the outer div
@@ -133,6 +135,7 @@ For popover/menu examples, wrap content in `s-popover is-visible ps-relative` (`
133135
## Rehype plugins (automatic — no action needed)
134136

135137
The `svelte.config.js` rehype pipeline automatically:
138+
136139
- Adds `docs-heading docs-h2/h3/h4` to markdown headings
137140
- Adds `docs-copy` to `p` and `ol` elements **in markdown prose only**
138141
- Adds `docs-section` to `<section>` elements (via rehype-sectionize)

packages/stacks-docs/README.md

Lines changed: 40 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -26,29 +26,31 @@ You can preview the production build with `npm run preview`.
2626
### Navigation
2727

2828
The site navigation is controlled by `src/structure.yaml`. This file defines:
29+
2930
- Top-level sections (Brand, Copywriting, Product, etc.)
3031
- Navigation hierarchy and nesting
3132
- Page titles, slugs, and metadata
3233
- Which pages are marked as private (employee-only)
3334

3435
Example structure:
36+
3537
```yaml
3638
navigation:
37-
- title: "Brand"
38-
slug: "brand"
39-
description: "Visual patterns and guidelines"
40-
items:
41-
- title: "Logo"
42-
slug: "logo"
43-
image: "/images/heros/logo.svg"
44-
45-
- title: "Border radius"
46-
slug: "border-radius"
47-
image: "/images/heros/border-radius.svg"
48-
49-
- title: "Brand strategy"
50-
slug: "strategy"
51-
private: true # Employee-only content
39+
- title: "Brand"
40+
slug: "brand"
41+
description: "Visual patterns and guidelines"
42+
items:
43+
- title: "Logo"
44+
slug: "logo"
45+
image: "/images/heros/logo.svg"
46+
47+
- title: "Border radius"
48+
slug: "border-radius"
49+
image: "/images/heros/border-radius.svg"
50+
51+
- title: "Brand strategy"
52+
slug: "strategy"
53+
private: true # Employee-only content
5254
```
5355
5456
Each navigation item should point to content in `src/docs/public` or `src/docs/private`. Pages are rendered by the SvelteKit/mdsvex docs app; do not add `legacy:` entries for new or migrated pages.
@@ -58,6 +60,7 @@ Each navigation item should point to content in `src/docs/public` or `src/docs/p
5860
Documentation is built using [mdsvex](https://mdsvex.pngwn.io/), which allows you to use Svelte components within Markdown files. The build process automatically adds several features:
5961

6062
**Automatically Added:**
63+
6164
- **Table of Contents** - Extracted from headings and exposed via `toc` in frontmatter
6265
- **Heading IDs** - All headings get slug IDs for direct linking (e.g., `## Color hierarchy` → `id="color-hierarchy"`)
6366
- **Section wrappers** - Content is automatically wrapped in `<section>` elements
@@ -68,6 +71,7 @@ Documentation is built using [mdsvex](https://mdsvex.pngwn.io/), which allows yo
6871

6972
**Svelte Components in Markdown:**
7073
You can import and use Svelte components directly in your markdown:
74+
7175
```markdown
7276
<script>
7377
import ColorSwatch from './ColorSwatch.svelte'
@@ -89,15 +93,18 @@ Documentation content lives in two directories:
8993
Public-facing documentation accessible to everyone. The directory structure maps directly to URL routes:
9094

9195
**Route Patterns:**
96+
9297
- `src/docs/public/brand/logo.md` → `/brand/logo`
9398
- `src/docs/public/brand/color/index.md` → `/brand/color`
9499

95100
**Files can be organized in two ways:**
101+
96102
1. **Single file:** `route.md` for simple pages
97103
2. **Directory with index:** `route/index.md` for pages with supporting files
98104

99105
**Supporting Files:**
100106
You can place images, Svelte components, YAML data, and other assets alongside your markdown:
107+
101108
```
102109
src/docs/public/brand/color/
103110
├── index.md # Main content
@@ -108,6 +115,7 @@ src/docs/public/brand/color/
108115

109116
**Image Handling:**
110117
Images and non-markdown files are automatically copied from `src/docs/` to `static/docs/` during build by the Vite plugin in `vite.config.ts`. Reference them in markdown using relative paths:
118+
111119
```markdown
112120
![Color palette](./stack-color-combos.svg)
113121
```
@@ -129,24 +137,26 @@ The private docs follow the same structure and conventions as public docs. Mark
129137
### Adding a New Page
130138

131139
1. **Create the content file** in the appropriate location:
132-
```sh
133-
# Simple page
134-
touch src/docs/public/brand/new-page.md
135140

136-
# Page with supporting files
137-
mkdir src/docs/public/brand/new-page
138-
touch src/docs/public/brand/new-page/index.md
139-
```
141+
```sh
142+
# Simple page
143+
touch src/docs/public/brand/new-page.md
144+
145+
# Page with supporting files
146+
mkdir src/docs/public/brand/new-page
147+
touch src/docs/public/brand/new-page/index.md
148+
```
140149

141150
2. **Add the page to navigation** in `src/structure.yaml`:
142-
```yaml
143-
- title: "Brand"
144-
slug: "brand"
145-
items:
146-
- title: "New Page"
147-
slug: "new-page"
148-
image: "/images/heros/new-page.svg" # Optional, relative to 'static' director
149-
```
151+
152+
```yaml
153+
- title: "Brand"
154+
slug: "brand"
155+
items:
156+
- title: "New Page"
157+
slug: "new-page"
158+
image: "/images/heros/new-page.svg" # Optional, relative to 'static' director
159+
```
150160

151161
3. **Add any images or assets** to the same directory as your markdown file
152162

0 commit comments

Comments
 (0)