storybook: loading shared styles with sass-loader is broken
See original GitHub issueCurrent Behavior
Importing shared scss into a Storybook via
// preview.js
// tried both in the lib's .storybook and the main repo top-level .storybook (neither work)
import "!style-loader!css-loader!sass-loader!../src/styles/styles.scss";
is not working via Nx.
NOTE: It is working with the standard Storybook setup following https://storybook.js.org/tutorials/intro-to-storybook/angular/en/get-started/ and adding custom “shared” scss
Expected Behavior
Expect this to work as per default Storybook - was also working in the past…
Steps to Reproduce
Create an Nx workspace with shared styles as per Nx example repo. https://github.com/nrwl/nx-examples
Import the shared styles via
// preview.js
import "!style-loader!css-loader!sass-loader!../src/styles/styles.scss";
Another report of the same issue here https://github.com/nrwl/nx/issues/7613#issuecomment-1022680386
Failure Logs
No logs are created.
Environment
Nx 13.7.3 Angular 13.2.1 @storybook-angular 6.4.18
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Import scss file is not working inside storybook file
I'm using sb init to create the storybook file. Everything is working, all the addons loaded but only the style is not working....
Read more >Styling and CSS - Storybook
Storybook is a frontend workshop for building UI components and pages in isolation. Thousands of teams use it for UI development, testing, and...
Read more >Loading Styles - SurviveJS
Webpack provides support for the most popular styling approaches as listed below: To use Less preprocessor, see less-loader. Sass requires sass-loader or fast- ......
Read more >Creating a React Component Library using Rollup, Typescript ...
Up until now, we had no shared style-sheets or components. ... Storybook uses Webpack to serve and load JS modules.
Read more >Configuring Storybook: 6 Tips You Can't Miss | by Zheng Li
use: ['style-loader', 'css-loader', 'sass-loader'], include: path.resolve(__dirname, '../'), });. Config the necessary alias that already ...
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
@mandarini amazing! thanks for all your help!
New docs for
styles
andstylePreprocessorOptions