-
Notifications
You must be signed in to change notification settings - Fork 101
feat(docs-next): UI-focused cleanup + fixes; content parity with beta #2239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
258 commits
Select commit
Hold shift + click to select a range
327a70c
feat(docs-next): add ClassTable component + convert activity-indicato…
dancormier bdea068
fix(docs-next): rename ClassTable prop rows→classes and fix tabindex …
dancormier eb42fea
fix(docs-next): restore full activity-indicator examples with correct…
dancormier 99fd9ac
fix(docs-next): remove IconShieldXSm — not in public stacks-icons pac…
dancormier ef9600a
fix(docs-next): remove remaining IconShieldXSm from variations block
dancormier 48f51e5
feat(docs-next): add Example component and style example containers
dancormier fa2ad8b
fix(docs-next): use bc-black-225 for Example container border
dancormier d8851c0
fix(docs-next): restore original prose text under Default heading
dancormier 83e3dc0
fix(docs-next): restore original Default code block verbatim
dancormier dc7cee6
feat(docs-next): restore heading anchor icons on all mdsvex pages
dancormier e607e53
feat(docs-next): replace copy-to-markdown button with copy-link icon …
dancormier 4c6a600
fix(docs-next): use s-btn__link and smaller icon for breadcrumb copy …
dancormier c52c5cb
fix(docs-next): use Button component and atomic classes for breadcrum…
dancormier 3eb575c
fix(docs-next): clean up breadcrumb layout with flex + gap
dancormier f799f34
fix(docs-next): add d-inline-flex to breadcrumb copy button
dancormier 824eb90
fix(docs-next): restore IconShieldXSm from stacks-icons-legacy
dancormier a55ae8c
fix(docs-next): hide Contents sidebar on smaller viewports instead of…
dancormier 9647616
fix(docs-next): allow .doc flex item to shrink to prevent horizontal …
dancormier a5f4e97
refactor(docs-next): replace all flex--item* classes with explicit ut…
dancormier 231acdc
fix(docs-next): cap article at wmx12 to constrain content width
dancormier ccc281c
fix(docs-next): use wmx9 on .doc to cap content column at 960px
dancormier 1d0d485
feat(docs-next): convert avatars page to mdsvex
dancormier ec2d864
fix(docs-next): limit activity avatar examples to 16px and 24px
dancormier 91ae4b6
fix(docs-next): use explicit bg classes and team-avatar.png in Stack …
dancormier 1c16b34
fix(docs-next): update Stack Internal table headings to Default color…
dancormier c3c88a1
fix(docs-next): allow overflow to be visible on Example container
dancormier 52bc1ee
fix(docs-next): rename Stack Internal column heading Default color → …
dancormier dad1426
fix(docs-next): use Button link variant for Edit/Figma/Svelte action …
dancormier a6c137a
fix(docs-next): increase action button gap to g16 and apply fs-caption
dancormier b67153c
fix(docs-next): use Link component for Edit/Figma/Svelte action buttons
dancormier dfd4820
fix(docs-next): fix TOC active item highlighting accuracy
dancormier 044e591
feat(docs-next): convert badges page to mdsvex
dancormier 9c650bf
feat(docs-next): add collapsible Show all classes button to ClassTable
dancormier 6f49c40
fix(docs-next): remove wmx5 from description, replace gs* with g* in …
dancormier 096829d
feat(docs-next): refactor ClassTable with v-truncate-fade and flexibl…
dancormier 04b40e7
fix(docs-next): make ClassTable expandable opt-in (default false)
dancormier 551dc35
feat(docs-next): convert banners page to mdsvex
dancormier c13e710
feat(docs-next): extract BannerDemo component for banners interactive…
dancormier 53afb43
feat(docs-next): scope Stack Sans Text to nav and branded UI, not bod…
dancormier 64a8bb5
feat(docs-next): apply ff-stack-sans-headline to nav/TOC; orange → th…
dancormier 6e049cc
fix(docs-next): add custom theme color palette so theme toggle works
dancormier 667c158
fix(docs-next): add ps-relative to static banner examples to prevent …
dancormier adc3094
fix(docs-next): fix banners page structure and example content
dancormier 61b7b8f
fix(docs-next): remove Last updated date from all docs pages
dancormier 53caa57
fix(docs-next): only hide Last updated on /system pages; restore it o…
dancormier ef57cc0
Merge remote-tracking branch 'origin/main' into STACKS-843/legacy-hea…
dancormier 6aa52cc
fix(docs-next): remove explicit font-weight from body — inherits from…
dancormier 008ec16
feat(docs-next): Stack Sans Text for docs UI, system font inside exam…
dancormier 5dc3326
fix(docs-next): body font-weight 300; reset to initial inside Example…
dancormier 3beacbf
fix(docs-next): fix banner example layout and add bg-black-100 to dem…
dancormier 6fbe24a
Revert "fix(docs-next): fix banner example layout and add bg-black-10…
dancormier 3f5ddca
fix(docs-next): add is-pinned to static banner examples; bg-black-100…
dancormier e89b45f
feat(docs-next): use Notice Svelte component for banner examples
dancormier 51c0216
Revert "feat(docs-next): use Notice Svelte component for banner examp…
dancormier 5981092
feat(docs-next): create BannerExample component for banner static exa…
dancormier d09bb1f
fix(docs-next): default BannerDemo to warning + important + pinned
dancormier ff5c305
feat(docs-next): use Select and Checkbox Svelte components in BannerDemo
dancormier 3d06a97
fix(docs-next): restore original JavaScript section on banners page
dancormier 39eb77f
fix(docs-next): restore original table content in banners JavaScript …
dancormier 74e1b48
feat(docs-next): convert bling page to mdsvex
dancormier 26eae9c
fix(docs-next): restore bling example tables and add Figma link
dancormier 0623401
feat(docs-next): add ExampleTable component; use in bling page
dancormier a39ea19
feat(docs-next): add Classes section, Sizes note, fix figma URL on bu…
dancormier 64b108a
fix(docs-next): wrap Notice content in span to prevent flex layout is…
dancormier 10a8f4d
feat(docs-next): wrap all button example tables in Example containers
dancormier 2e54097
feat(docs-next): wrap ordering examples in Example; convert additiona…
dancormier fe0bdea
fix(docs-next): use native Google SVG colors in Social example
dancormier 4125419
fix(docs-next): add mb16 to Sizes notice
dancormier 82e129a
fix(docs-next): escape curly braces in code-blocks pre elements
dancormier b1fea7a
feat(docs-next): convert code-blocks page to mdsvex
dancormier 29409ab
fix(docs-next): restore search button, add figma+code to code-blocks
dancormier 8df63b9
fix(docs-next): fix search button styling and remove disabled state
dancormier 46a16d0
fix(docs-next): use Link for search button; fix mb128 forehead on ima…
dancormier 48011b7
fix(docs-next): add spacing around nav header and above navigation list
dancormier effce6d
feat(docs-next): add editor page with live StacksEditor demos
dancormier 6e76fff
fix(docs-next): fc-brand on logo, restore pt16 px24 padding on nav he…
dancormier 7d5d94d
fix(docs-next): double top padding on nav header to pt32
dancormier 1265fe3
feat(docs-next): convert empty-states page to mdsvex
dancormier 0000a40
refactor(docs-next): replace .doc X descendant selectors with individ…
dancormier 560d6a7
fix(docs-next): keep --brand-color-* tokens, remove duplicate utility…
dancormier cb60920
fix(docs-next): add wmx4 p48 to all EmptyState examples
dancormier 14605de
revert(docs-next): restore Search.svelte to its original state
dancormier ac10d5b
fix(docs-next): use actual markdown content for editor tables example
dancormier 833a4fb
feat(docs-next): convert links page to mdsvex
dancormier ecc56e0
fix(docs-next): replace docs-card with s-card in anchor examples; mat…
dancormier c4087f8
fix(docs-next): add .docs-card CSS; use it (not s-card) in anchor exa…
dancormier f6805d7
fix(docs-next): remove docs-card from code blocks; keep in Examples only
dancormier 0ce7023
docs(docs-next): add TODO for s-anchors styling within s-prose
dancormier 9914328
refactor(docs-next): remove docs-p class
dancormier ffdb6d7
fix(docs-next): use HTML code tags in links description (rendered via…
dancormier 7bc8f2c
feat(docs-next): convert loader page to mdsvex
dancormier 17fe981
fix(docs-next): add parent column to ClassTable; use it in loader.md
dancormier b256bec
fix(docs-next): add parent column to avatars/banners/buttons class ta…
dancormier d3a4d91
fix(docs-next): constrain description/definition column to s-table--c…
dancormier adf9211
fix(docs-next): render N/A in fc-black-400 in ClassTable
dancormier a52c01c
fix(docs-next): N/A color fc-black-400 → fc-black-350
dancormier e40fe06
fix(docs-next): render class names as inline code in ClassTable columns
dancormier 8447edd
feat(docs-next): convert menus page to mdsvex
dancormier d440dcb
fix(docs-next): restore navigation link in menus examples intro
dancormier 79bf0e8
fix(docs-next): restore popover and card links in menus Basic section…
dancormier 5cb514b
feat(docs-next): add docs-copy class to all p elements via rehype plugin
dancormier fc50f58
fix(docs-next): add color: inherit to .docs-copy a:not([class])
dancormier c6baa06
fix(docs-next): apply color: inherit to .docs-copy .docs-link
dancormier 591d0ad
fix(docs-next): add ws1 to Basic examples, ws2 to all other menu exam…
dancormier 16b800c
feat(docs-next): convert modals page to mdsvex
dancormier 05404da
chore(docs-next): delete 53 unused legacy fragment files
dancormier 90aa205
fix(docs-next): use ClassTable for all modals tables; fix examples se…
dancormier 95d4d9b
fix(docs-next): propagate positioning to s-modal--dialog for inline e…
dancormier d2e9ae0
Revert "fix(docs-next): propagate positioning to s-modal--dialog for …
dancormier 35b4ff7
fix(docs-next): inline modal examples — no p16, ps-absolute z-base mn…
dancormier d8e160c
fix(docs-next): use raw HTML for inline modal examples so ps-absolute…
dancormier 068c2f9
fix(docs-next): make Attributes and Events tables expandable with cus…
dancormier 7e36b3c
feat(docs-next): add JavaScript action link for pages with a JS section
dancormier 7ac2e59
fix(docs-next): move JavaScript link before Figma/Svelte; add IconCode
dancormier 57b6454
fix(docs-next): use IconCodeBox for JavaScript link
dancormier e02910d
fix(docs-next): fc-green-400 on JavaScript link icon
dancormier d6bcc43
fix(docs-next): modal events table always expanded (not collapsible)
dancormier 73e587e
feat(docs-next): add ExampleTable to all 7 badge sections with correc…
dancormier 9140cc9
fix(docs-next): wrap ExampleTable in Example containers; add N/A to d…
dancormier 01d2026
fix(docs-next): convert banners JS section markdown tables to ClassTa…
dancormier 71035c3
fix(docs-next): add margin-top to docs-h3/h4 so subsection headings h…
dancormier 617c0c4
fix(docs-next): apply docs-copy to ol elements via rehype plugin
dancormier f27d319
feat(docs-next): make second editor example taller via docs-editor-ta…
dancormier 564375a
fix(docs-next): Basic menu examples — ws2 on popover, add section hea…
dancormier 2564657
fix(docs-next): use s-popover is-visible ps-relative for menu examples
dancormier 13e9a3f
fix(docs-next): use s-popover is-visible ps-relative for icons and se…
dancormier 1fd50a1
fix(docs-next): add 'With radio input' and 'With checkbox input' head…
dancormier f5ad6d5
fix(docs-next): use raw s-radio markup for radio groups example
dancormier b9c7892
fix(docs-next): widen radio groups example popover to ws3
dancormier dc83135
fix(docs-next): use ff-mono mb8 for example section labels
dancormier 4779230
fix(docs-next): convert modals sizes markdown table to ClassTable
dancormier e0bd1ba
feat(docs-next): convert navigation page to mdsvex
dancormier 748d90b
fix(docs-next): replace legacy HTML removal notice with Notice component
dancormier 95b0454
fix(docs-next): update v2 docs link to v2.stackoverflow.design
dancormier fc8ff22
fix(docs-next): add removed-in-v3 components to side navigation
dancormier 1a4f131
fix(docs-next): wrap removal notice text in p to isolate from flex la…
dancormier d732558
fix(docs-next): grow content area to push footer to bottom of page
dancormier a92447c
fix(docs-next): update v2 docs link to using-stacks page
dancormier 1075f41
fix(docs-next): remove legacy flag from navigation so mdsvex page loads
dancormier 63e018a
fix(docs-next): remove s-prose from doc wrapper to isolate component …
dancormier c086192
fix(docs-next): restore font-weight 700 on page h1 and section headings
dancormier 7e11837
fix(docs-next): set docs-h2 font-size to fs-headline1
dancormier b9cfb93
fix(docs-next): set docs-h3 color to black-500
dancormier bf59ef0
fix(docs-next): double spacing between h2 and h3 sections
dancormier 2e0fc4d
docs: add CLAUDE.md with component page conversion guide for stacks-d…
dancormier d6eca41
feat(docs-next): convert notices page to mdsvex
dancormier b012ac1
fix(docs-next): expand styling child links example to show each s-anc…
dancormier 174990d
fix(docs-next): move s-anchors classes onto the anchor element in sty…
dancormier a51de25
fix(docs-next): pass s-anchors classes to Notice component, not the a…
dancormier 9ff861f
fix(docs-next): add s-anchors classes to all Notice components except…
dancormier ad72148
fix(docs-next): set role=presentation on all Notice components in exa…
dancormier 831e122
fix(docs-next): use role=presentation on inline modal examples
dancormier 2890c81
feat(docs-next): convert pagination page to mdsvex
dancormier c5c8f89
fix(docs-next): set h2 section margin-top to var(--su48)
dancormier 8240219
fix(docs-next): replace hardcoded px values with Stacks custom proper…
dancormier f0971b9
fix(docs-next): remove custom fw-* classes in favour of Stacks atomic…
dancormier a05b6f5
fix(docs-next): replace remaining hardcoded values with Stacks custom…
dancormier 6e4d32e
fix(docs-next): define --fw-bold custom property and use it for stron…
dancormier b468fac
fix(docs-next): apply docs-copy class to page description below h1
dancormier fc0ae43
fix(docs-next): set pagination example to page 2 to show both nav arrows
dancormier 14b1b03
fix(stacks-svelte): remove hardcoded pl24 from Pagination nav element
dancormier 4108427
fix: add role prop to Pagination/PaginationController; use presentati…
dancormier 5b0a2cc
revert: undo role prop changes to Pagination Svelte components
dancormier a1cb7d7
fix(docs-next): add mln24 to pagination example to offset component l…
dancormier 415ffbe
feat(docs-next): convert popovers page to mdsvex
dancormier adeea8e
fix(docs-next): use EmptyState component in popover example to includ…
dancormier 7c48561
fix(docs-next): remove trapFocus from dismissible popover example to …
dancormier 7f1d174
fix(docs-next): add hover tooltip to combined tooltip+popover example
dancormier bddef2a
feat(docs-next): convert post-summary page to mdsvex
dancormier 477a145
feat(docs-next): convert prose page to mdsvex
dancormier c1c4b00
fix(docs-next): fix 500 on prose page by moving HTML to dedicated com…
dancormier c4d5143
fix(docs-next): escape curly braces in ProseContent code block
dancormier 6b59ff8
fix(docs-next): isolate s-prose examples from docs custom fonts
dancormier 945deea
fix(docs-next): explicitly set font-family on s-prose in example cont…
dancormier 23c5825
feat(docs-next): convert sidebar-widgets page to mdsvex
dancormier 5d24bbe
fix(docs-next): add mb16 to notices in doc content
dancormier e3e9c39
feat(docs-next): convert tables page to mdsvex
dancormier 1545b29
fix(docs-next): import sort arrow icons from stacks-icons-legacy
dancormier bfc8dd4
fix(docs-next): escape > in data-action attribute value in tables exa…
dancormier 581d865
fix(docs-next): add missing tbody to cell widths table examples
dancormier e898776
fix(docs-next): remove Icon components from table template cells
dancormier 886498e
fix(docs-next): pass widths/atomic as classes= prop to ClassTable
dancormier 27c346b
fix(docs-next): clean up spurious debugging changes in tables page
dancormier 8eb1038
fix(docs-next): use inline SVG for sort icons in tables examples
dancormier 4e68576
feat(docs-next): implement live sorting in tables JS example
dancormier 44a7f57
feat(docs-next): convert tags page to mdsvex
dancormier f644408
fix(docs-next): render tag sizes as a table with live examples
dancormier fcd36af
fix(docs-next): remove unnecessary s-anchors classes from tag sizes t…
dancormier 96508c6
fix(docs-next): wrap tag sizes table in Example container
dancormier e0de827
fix(docs-next): rearrange tag sizes to match badges pattern
dancormier bc99e74
feat(docs-next): convert toggle-switch page to mdsvex
dancormier e51509d
fix(docs-next): adjust docs heading and section spacing
dancormier 5e44301
fix(docs-next): use adjacent sibling selector for h3 after h2 spacing
dancormier 8b02955
fix(docs-next): set docs-section margin-top to var(--su24)
dancormier 177f18e
feat(docs-next): convert user-cards and vote pages to mdsvex
dancormier e4a18d8
chore: misc cleanup — remove obsolete legacy fragments, flatten butto…
dancormier 690b356
feat(docs-next): merge Forms into Components; convert all forms pages…
dancormier 0c571f8
fix(docs-next): fix nav cascade, heading font, h4 spacing, breadcrumb…
dancormier cc64a40
fix(docs-next): fix sizes tables, base/checkmark examples, and Notice…
dancormier 11934e0
feat(docs-next): convert backgrounds page to ClassTable + Example
dancormier 822f46d
docs(base): convert borders to ClassTable; remove updated metadata; u…
dancormier a140e69
docs(ClassTable): center responsive column heading and icon
dancormier ae6a2df
feat(docs): replace fixed nav with three-column flex layout
dancormier ac8eb2f
fix(docs): fix ToC sticky, add white bg, add top gap on content columns
dancormier d7d0463
fix(docs): increase top gap on content columns to su24
dancormier d7b620c
fix(docs): span banner across main + ToC columns; restore top gap
dancormier c392c42
fix(docs): don't render ToC aside when there are no headings
dancormier 4528fa6
fix(docs): set ToC width to wmn1 wmx2 w100
dancormier 0162cc8
fix(docs): remove fl-grow1 from main so ToC sits adjacent to content
dancormier 09f4483
fix(docs): move bg-white to layout-body so it spans full viewport width
dancormier bcae6ba
fix(docs): make ToC width proportional with w20 wmn2 wmx3
dancormier c17558f
fix(docs): increase ToC width from w20 to w30
dancormier 48d1251
fix(docs): make nav width proportional with w20 wmn2 wmx3
dancormier 9451b6d
refactor(docs): move nav layout to Stacks classes; remove .layout-nav…
dancormier acade90
fix(docs): move Edit on GitHub link to end of page action links
dancormier 261771a
fix(home): vertically center content, fill width, cap at wmx12
dancormier 146278b
fix(docs): double ToC inner padding from px16 to px32
dancormier 16a9954
fix(home): correctly vertically center page content
dancormier 8b4c249
docs(stacks-docs-next): convert base + component pages to mdsvex format
dancormier 9978656
docs(stacks-docs-next): convert foundation pages to mdsvex format
dancormier 7f10dbd
chore(stacks-docs-next): remove unreferenced legacy static assets
dancormier 379ca95
chore(docs-next): remove legacy static assets and dead commented code
dancormier 9edbf1c
refactor(docs-next): rename doc components for clarity
dancormier 01ab4ec
fix(docs-next): rewrite Grid with CSS grid, fix SSR column-count bug
dancormier f9463e2
fix(docs-next): brand section visual polish
dancormier 872efab
fix(docs-next): copy + accessibility page content improvements
dancormier 2432bfd
docs(docs-next): rewrite CLAUDE.md for ongoing maintenance
dancormier f8c765f
fix(docs-next): icons page full-width layout and hide inspector aside
dancormier 6526821
chore: sync package-lock.json with stacks-docs-next dependencies
dancormier b43e39f
fix(docs-next): resolve @stackoverflow/stacks via ESM entry for Rollup
dancormier e1b4c15
ci: also run checks on main branch pushes and PRs
dancormier 0574d68
fix(docs-next): add each-block keys and suppress safe @html lint errors
dancormier 9555f36
refactor(docs-next): code cleanup and file organization
dancormier 0190b34
fix(docs-next): remove empty extraClasses="" props from GridColumn
dancormier 67f326d
chore(docs-next): remove old file locations after subdirectory moves
dancormier a6c0280
fix(docs-next): replace raw SVGs in TableSortDemo with stacks-icons
dancormier 6ce5fab
fix(docs-next): use IconChevron16UpDown for unsorted table column ind…
dancormier 3afb81d
feat(docs-next): extract form components into dedicated Forms nav sec…
dancormier 5a2941c
fix(docs-next): always set w100 on main so 404 page centers correctly
dancormier f4e70a0
Update packages/stacks-docs-next/src/routes/[category]/[[section]]/[s…
dancormier 407ba81
Update packages/stacks-docs-next/svelte.config.js
dancormier d70b1d1
fix(docs-next): use overflow-hidden class instead of inline style on …
dancormier 8a0a105
fix(docs-next): import IconLink in svelte.config.js for heading anchors
dancormier 23d062e
chore(docs-next): update private docs submodule
dancormier 3c00faf
chore: trigger CI
dancormier b1bebbf
chore: trigger CI
dancormier 6ca0cb1
Resolve PR issues: custom avatar images, notices typography, user car…
dancormier 9375c46
Fix object-fit docs images
dancormier ab7317a
Use notice component for Using Stacks warning
dancormier 2be1c0e
Use Stacks icons for JavaScript do and don't examples
dancormier File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| // ESM entry for bundlers that need named exports (e.g. Vite/Rollup). | ||
| // Mirrors lib/index.ts but omits the CSS side-effect import; | ||
| // consumers should import the stylesheet separately. | ||
| import { | ||
| BannerController, | ||
| ModalController, | ||
| PopoverController, | ||
| TableController, | ||
| TabListController, | ||
| ToastController, | ||
| TooltipController, | ||
| } from "./controllers"; | ||
| import { application, StacksApplication } from "./stacks"; | ||
|
|
||
| application.register("s-banner", BannerController); | ||
| application.register("s-modal", ModalController); | ||
| application.register("s-toast", ToastController); | ||
| application.register("s-navigation-tablist", TabListController); | ||
| application.register("s-popover", PopoverController); | ||
| application.register("s-table", TableController); | ||
| application.register("s-tooltip", TooltipController); | ||
|
|
||
| StacksApplication.finalize(); | ||
|
|
||
| export * from "./controllers"; | ||
| export * from "./stacks"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,5 +22,4 @@ Thumbs.db | |
| vite.config.js.timestamp-* | ||
| vite.config.ts.timestamp-* | ||
|
|
||
| /static/docs | ||
| /static/legacy | ||
| /static/docs | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,196 @@ | ||
| # stacks-docs-next — Claude Instructions | ||
|
|
||
| This is the SvelteKit documentation site for the Stacks v3 design system. Pages are written in mdsvex (`.md` files with Svelte support). | ||
|
|
||
| ## Page anatomy | ||
|
|
||
| ### Frontmatter | ||
|
|
||
| ```yaml | ||
| --- | ||
| title: "Page Title" | ||
| description: "…" # shown in the page header and meta | ||
| figma: "https://…" # optional — links to Figma file | ||
| svelte: "https://…" # optional — links to stacks-svelte component | ||
| js: true # only if the page has a JavaScript section | ||
| updated: 2026-01-15 # ISO date of last meaningful content update | ||
| --- | ||
| ``` | ||
|
|
||
| ### Script block | ||
|
|
||
| ```svelte | ||
| <script lang="ts"> | ||
| import { ComponentName } from '@stackoverflow/stacks-svelte'; | ||
| import { IconName } from '@stackoverflow/stacks-icons/icons'; | ||
| import ClassTable from '$components/ClassTable.svelte'; | ||
| import Example from '$components/Example.svelte'; | ||
| import type { ClassTableRow } from '$components/ClassTable.svelte'; | ||
|
|
||
| const classes: ClassTableRow[] = [ … ]; | ||
| </script> | ||
| ``` | ||
|
|
||
| ### Content | ||
|
|
||
| Use standard markdown for prose. Svelte components can be used anywhere in the body. Fenced code blocks use explicit language tags (` ```html `, ` ```js `, etc.). | ||
|
|
||
| ## Adding a new page | ||
|
|
||
| 1. Create `src/docs/public/<section>/<name>.md` | ||
| 2. Add an entry to `src/structure.yaml` under the correct section in **alphabetical order** — no `legacy:` key needed for new pages: | ||
|
|
||
| ```yaml | ||
| - title: "Page Title" | ||
| slug: "page-name" | ||
| ``` | ||
|
|
||
| ## Available doc components | ||
|
|
||
| | Component | Location | Purpose | | ||
| |---|---|---| | ||
| | `ClassTable` | `$components/ClassTable.svelte` | CSS class / JS attribute reference tables | | ||
| | `Example` | `$components/Example.svelte` | Bordered container for static example content | | ||
| | `Grid` | `$components/Grid.svelte` | Equal-width responsive column grid for Do/Don't blocks | | ||
| | `GridColumn` | `$components/GridColumn.svelte` | Column within a `Grid`; accepts `extraClasses`, `padding` prop | | ||
| | `PreviewTable` | `$components/PreviewTable.svelte` | Table of component previews: Example \| Class \| Description | | ||
| | `BannerPreview` | `$components/BannerPreview.svelte` | Static pre-built banner instance for illustration | | ||
| | `BannerDemo` | `$components/BannerDemo.svelte` | Interactive banner playground with user controls | | ||
| | `StacksEditorDemo` | `$components/StacksEditorDemo.svelte` | Interactive Stacks editor playground | | ||
| | `TableSortDemo` | `$components/TableSortDemo.svelte` | Interactive sortable table playground | | ||
|
|
||
| **Naming convention:** `Example` = generic wrapper; `*Preview` = static pre-built component instance; `*Demo` = interactive playground with user controls. | ||
|
|
||
| ### ClassTable | ||
|
|
||
| Use `ClassTable` for every reference table — never raw markdown tables. | ||
|
|
||
| ```svelte | ||
| <ClassTable {classes} expandable /> | ||
|
|
||
| <!-- JS section tables — rename columns as appropriate --> | ||
| <ClassTable classes={attributes} headings={{ class: 'Attribute', parent: 'Applies to' }} /> | ||
| <ClassTable classes={events} headings={{ class: 'Event', parent: 'Applies to' }} /> | ||
| ``` | ||
|
|
||
| **ClassTableRow fields:** `class`, `parent`, `modifies`, `output`, `description`, `define`, `responsive`. | ||
| - Only populate relevant fields — `ClassTable` auto-hides columns with no data. | ||
| - Use `'N/A'` (string) for explicitly empty `parent`/`modifies` — renders as muted text. | ||
| - The `headings` prop renames any column: `headings={{ class: 'Selector', description: 'Notes' }}`. | ||
|
|
||
| ### Example | ||
|
|
||
| All component examples must be wrapped in `<Example>`. Multiple labelled variants in one block: | ||
|
|
||
| ```svelte | ||
| <Example> | ||
| <div class="d-flex g16 ai-start fw-wrap"> | ||
| <div class="d-flex fd-column g8"> | ||
| <span class="ff-mono mb8">Label</span> | ||
| <ComponentName /> | ||
| </div> | ||
| </div> | ||
| </Example> | ||
| ``` | ||
|
|
||
| Sub-example labels always use `class="ff-mono mb8"`. | ||
|
|
||
| ### Grid / GridColumn | ||
|
|
||
| `Grid` renders an equal-width responsive CSS grid (stacks to a single column below 780px). Use it for Do/Don't comparisons and side-by-side content blocks. | ||
|
|
||
| ```svelte | ||
| <Grid> | ||
| <GridColumn extraClasses="bg-red-100"> | ||
| <!-- Don't content --> | ||
| </GridColumn> | ||
| <GridColumn extraClasses="bg-green-100"> | ||
| <!-- Do content --> | ||
| </GridColumn> | ||
| </Grid> | ||
| ``` | ||
|
|
||
| `GridColumn` props: | ||
| - `extraClasses` — appended to the column div (default: `bg-black-200`) | ||
| - `padding` — adds `p24` when `true` (default: `true`); set `false` if you're applying `py*` in `extraClasses` to avoid conflict | ||
| - `...rest` — any extra attributes (e.g. `style="background: var(--brand-color-orange)"`) are spread onto the outer div | ||
|
|
||
| For the `column-strike` diagonal overlay on "Instead of this" blocks, add it to `extraClasses`: | ||
|
|
||
| ```svelte | ||
| <GridColumn extraClasses="bg-black-200 column-strike">…</GridColumn> | ||
| ``` | ||
|
|
||
| ### Svelte components vs raw HTML | ||
|
|
||
| - **Always prefer** Svelte components from `@stackoverflow/stacks-svelte` when one exists. | ||
| - **Fall back to raw HTML** only when the component's prop API can't express what the example needs. | ||
| - Check `packages/stacks-svelte/src/components/index.ts` for available components. | ||
| - Check story files (`*.stories.svelte`) for usage patterns. | ||
|
|
||
| For popover/menu examples, wrap content in `s-popover is-visible ps-relative` (`ws2 p8` or `ws3 p8`). | ||
|
|
||
| ## Rehype plugins (automatic — no action needed) | ||
|
|
||
| The `svelte.config.js` rehype pipeline automatically: | ||
| - Adds `docs-heading docs-h2/h3/h4` to markdown headings | ||
| - Adds `docs-copy` to `p` and `ol` elements **in markdown prose only** | ||
| - Adds `docs-section` to `<section>` elements (via rehype-sectionize) | ||
| - Adds `docs-link` to `<a>` elements | ||
| - Adds syntax highlighting via `s-code-block` to fenced code blocks | ||
| - Extracts the TOC from headings and exposes it as `metadata.toc` | ||
|
|
||
| ## Key conventions and gotchas | ||
|
|
||
| ### docs-copy not applied inside Svelte component slots | ||
|
|
||
| Rehype only processes markdown-level elements. Any `<p>`, `<ul>`, or `<ol>` written as raw HTML inside a Svelte component slot (e.g. inside `<GridColumn>`, `<Example>`) **will not** receive `docs-copy` automatically — add the class manually: | ||
|
|
||
| ```svelte | ||
| <GridColumn> | ||
| <p class="docs-copy">This text needs the class added explicitly.</p> | ||
| <ul class="docs-copy ml0 pl16"> | ||
| <li>Same for lists</li> | ||
| </ul> | ||
| </GridColumn> | ||
| ``` | ||
|
|
||
| ### Notice component — always wrap content in `<p>` | ||
|
|
||
| The `Notice` component uses flexbox internally. Bare text and inline elements become flex items and break the layout: | ||
|
|
||
| ```svelte | ||
| <!-- Correct --> | ||
| <Notice variant="info" class="mb16"> | ||
| <p>Text with <code>inline code</code> and <a href="…">links</a>.</p> | ||
| </Notice> | ||
|
|
||
| <!-- Wrong — bare text/inline elements become flex items --> | ||
| <Notice variant="info" class="mb16"> | ||
| Text with <code>inline code</code> and <a href="…">links</a>. | ||
| </Notice> | ||
| ``` | ||
|
|
||
| ### Global h1 size | ||
|
|
||
| The global `h1` rule sets `font-size: var(--fs-display3)` (4.5rem / 72px) — designed for page hero titles. If you use `<h1>` inside a content block (e.g. a `GridColumn`), add a scoped `<style>` to the page to bring it to a more appropriate size: | ||
|
|
||
| ```svelte | ||
| <style> | ||
| h1 { | ||
| font-size: var(--fs-headline1); | ||
| font-weight: 700; | ||
| line-height: 1.2; | ||
| } | ||
| </style> | ||
| ``` | ||
|
|
||
| ### Brand background colors | ||
|
|
||
| Not all `bg-brand-*` utility classes exist. If a class is missing (e.g. `bg-brand-orange`), use an inline `style` with the CSS variable instead: | ||
|
|
||
| ```svelte | ||
| <GridColumn style="background: var(--brand-color-orange)"> | ||
| ``` | ||
|
|
||
| Available brand color CSS variables are defined in `src/app.css` under `:root`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.