Skip to content

Add Storybook 10 style guide and design environment - #994

Merged
willtheorangeguy merged 1 commit into
mainfrom
claude/storybook-styleguide-setup-a3hb3r
Aug 8, 2026
Merged

Add Storybook 10 style guide and design environment#994
willtheorangeguy merged 1 commit into
mainfrom
claude/storybook-styleguide-setup-a3hb3r

Conversation

@willtheorangeguy

Copy link
Copy Markdown
Owner

Summary

  • Installs Storybook 10 with @storybook-astro/framework (community Astro 7 support) and @storybook/react for full Astro + React story coverage
  • Adds 16 component stories covering all 13 Astro components and all 3 React islands
  • Adds 2 MDX documentation pages: Introduction and Design Tokens (color palette, typography, spacing, focus styles)
  • Configures light/dark theme toggle matching the site's data-theme CSS variable system
  • Outputs the built style guide to public/styleguide/ so it deploys to /styleguide on the live site

What's included

Configuration

  • .storybook/main.ts — Astro framework + React integration + @storybook/addon-docs + @storybook/addon-themes
  • .storybook/preview.tswithThemeByDataAttribute decorator (light/dark), viewport presets (mobile/tablet/desktop)

Documentation pages (src/stories/)

  • Introduction.mdx — style guide overview, tech stack, file map
  • DesignTokens.mdx — visual color swatches for both themes, typography scale, spacing ruler, border radius grid, focus style example

Astro component stories (src/components/*.stories.ts)

Hr, LinkButton (with slots + disabled state), Tag (sm/lg), Datetime (published/updated/large), BackButton, Breadcrumb, Card (with mock blog post data, h2/h3/long-title/with-modified-date variants), Pagination (first/middle/last/two-page/single-page), Footer, Header, Socials, ShareLinks, EditPost

React island stories (src/components/*.stories.tsx)

GoogleMapsStats (default + invalid URL), UnsplashStats (default + with access key), Comments (default + high-contrast Giscus theme)

Build integration

  • package.json — adds storybook (dev server) and storybook:build scripts; Storybook now builds before astro build in npm run build so its output in public/styleguide/ is included in dist/
  • .github/workflows/astro.yml — adds "Build Storybook style guide" step before the Astro build step
  • .gitignore — excludes public/styleguide/ (generated at build time, same as public/pagefind)

Test plan

  • Run npm run storybook locally and open http://localhost:6006
  • Verify all component stories render in both light and dark themes
  • Verify Design Tokens and Introduction pages load under "Design System"
  • Run npm run storybook:build and confirm public/styleguide/index.html exists
  • After merge, confirm the style guide is live at /styleguide on the deployed site

Generated by Claude Code

Sets up @storybook-astro/framework with @storybook/react for a full
Astro + React component story suite, output to public/styleguide/ so
the style guide is served at /styleguide on the deployed site.

- .storybook/main.ts: Astro framework + React integration + docs/themes addons
- .storybook/preview.ts: light/dark theme toggle via data-theme, viewport presets
- src/stories/Introduction.mdx: style guide overview and file map
- src/stories/DesignTokens.mdx: visual palette, typography scale, spacing, focus styles
- Stories for all 13 Astro components: Hr, LinkButton, Tag, Datetime,
  BackButton, Breadcrumb, Card, Pagination, Footer, Header, Socials,
  ShareLinks, EditPost
- Stories for all 3 React islands: GoogleMapsStats, UnsplashStats, Comments
- .gitignore: excludes public/styleguide (generated at build time)
- package.json: adds storybook/storybook:build scripts; Storybook builds
  before astro build so its output lands in dist/ for deployment
- astro.yml: adds "Build Storybook style guide" step before Astro build

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LgBsw219iQB1xJVRdwbkxN
@willtheorangeguy
willtheorangeguy merged commit a4daf38 into main Aug 8, 2026
9 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants