-
Notifications
You must be signed in to change notification settings - Fork 5
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
USWDS-Next - Storybook: Add initial implementation #14
Conversation
Based on default light theme. This is the recommended way of updating the title and setting some baseline defaults for Storybook UI. **Note** Setting a brand image will completely replace the text. Potential workaround here if we really want logo + text - storybookjs/storybook#5866 (comment)
Added to load fonts locally, but seems like its intended for including assets in final build.
- Update title - Add basic USWDS colors
Docs updateI've enabled source code by default [0523b65] to avoid having to click on each variant for markup.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for putting this all together! This will be a huge help.
web-components/.storybook/preview.js
Outdated
toc: true, // Autogenerate table of contents. | ||
theme: UswdsTheme, | ||
canvas: { | ||
sourceState: 'shown' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note
Not a blocker, but indentation can be off in some previews. There's a workaround in this issue DocsPage code preview indentation is wrong · Issue #8078 · storybookjs/storybook.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, I got this working on the MD WDS project I'm working on!
Here are my notes on the workaround:
storybookjs/storybook#8078 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@caseywatts thanks for sharing. Created an issue to give this a try 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much for doing this! Pulled it into the card component work and it's working like a charm. One small comment for quote consistency on the stories page but not a blocker
Closes #6.
Blocked by #8.
Initial setup of StorybookJS in repo. Includes a few examples for:
Also created a small custom theme called
UswdsTheme.js
to use Public Sans, bump up default font size, and use some USWDS colors.Welcome page
Includes an example of what custom documentation using Storybook blocks looks like.
Embedded README
Example of embedding an existing README into page. Could be used for CHANGELOGs.
Component docs
Autogenerated component docs.
Component preview
Example of importing Lit component with configurable props.
How to test
web-components
directory.npm install
.npm start
.You should have a working storybook library powered by Vite.