Global preview-head.html for Storybook
See original GitHub issueExpected Behavior
If I add a preview-head.html
in the root .storybook
directory, to add custom styles (like Angular Material Icons) to Storybook, I would expect them to be applied to all storybook instances in the workspace.
Current Behavior
I have to add the same preview-head.html
in the .storybook
directory of all libs.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:12
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Story rendering - Storybook
Similarly to the preview head HTML, preview body HTML can also be updated programmatically using a preset. See Preview/Manager templates for more information....
Read more >6 Ways To Configure Global Styles for Storybook | by Jennifer Fu
In Storybook, stories are rendered in a particular “preview” iframe (the Canvas tab). The Storybook web application reads .storybook/preview-head.html if it ...
Read more >Configuring Storybook: 6 Tips You Can't Miss | by Zheng Li
Use preview.js for global code (such as CSS imports or JavaScript mocks) that applies to all stories. The preview.js file can be ...
Read more >Getting Started - Page ⋅ Storybook - Primer Design System
preview.js: customizations, decorators, global CSS imports. preview-head.html: story-level "global" styles (within the story iframe). Accessibility Controls
Read more >Add Custom Head Tags - Storybook
This is useful for adding web fonts or some external scripts. You can do this very easily. Simply create a file called preview-head.html...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @twittwer . It’s in our plans to address this issue with a schematic, possibly, along with other extra config files for Storybook. I’ll keep this issue updated.
@twittwer for now, you can use this solution: (for global use. at
.storybook
folder in the root)