Add Storybook 10 style guide and design environment - #994
Merged
Conversation
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
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
@storybook-astro/framework(community Astro 7 support) and@storybook/reactfor full Astro + React story coveragedata-themeCSS variable systempublic/styleguide/so it deploys to/styleguideon the live siteWhat's included
Configuration
.storybook/main.ts— Astro framework + React integration +@storybook/addon-docs+@storybook/addon-themes.storybook/preview.ts—withThemeByDataAttributedecorator (light/dark), viewport presets (mobile/tablet/desktop)Documentation pages (
src/stories/)Introduction.mdx— style guide overview, tech stack, file mapDesignTokens.mdx— visual color swatches for both themes, typography scale, spacing ruler, border radius grid, focus style exampleAstro 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,EditPostReact 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— addsstorybook(dev server) andstorybook:buildscripts; Storybook now builds beforeastro buildinnpm run buildso its output inpublic/styleguide/is included indist/.github/workflows/astro.yml— adds "Build Storybook style guide" step before the Astro build step.gitignore— excludespublic/styleguide/(generated at build time, same aspublic/pagefind)Test plan
npm run storybooklocally and open http://localhost:6006npm run storybook:buildand confirmpublic/styleguide/index.htmlexists/styleguideon the deployed siteGenerated by Claude Code