How do we configure Angular Themes for Storybook such that the Storybook rendered components can load all the classes provided by the Angular theme?
There’s a Styling and CSS "Hint" in the storybook documentation, but no example at how to go about loading the compiled global Angular SASS style sheets.
2
Answers
Turns out it's really simple. To import
styles.scss
just add this to./storybook/preview.js
:This answer is Nx specific but should be adaptable.
If you’re using a singular storybook-host
Example
libs/storybook-host/project.json
With
preview.html
A hazardous guess at what
angular.json
will look like (it’s been awhile since I’ve messed around with these files).