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
Storybook global styles not used for library component #8790
Comments
Hi @DimitriLib ! Thanks for filing an issue! If you try So, the best thing you can do is to add the styles under the
Let me know if you have questions! :) |
Hi @mandarini, nx storybook lib-test --projectBuildConfig=storybooktest Gives an error:
——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
But this command works and global styles are availabel on the lib: Thank you again! |
Yep, that's the error I mentioned in my previous comment! :) |
See nrwl/nx#8790 and nrwl/nx#8882 for information about storybook config changes.
New docs for |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
I am trying to access application/global styles from storybook library. My setup new repository with latest packages that nx installs as of 01/26/2022
Setup sample repository at https://github.com/DimitriLib/storybook-test if somebody want to try test it.
I have 1 application apps/storybooktest that is used as projectBuildConfig for libs/lib-test
storybooktest has global styles: styles.scss that i want to be able to access in my storybook library component.
I tried the following combinations without success, global styles are not available in lib project:
Executing command: nx storybook lib-test --projectBuildConfig=storybooktest:build-storybook
Updating preview.js with: import '!style-loader!css-loader!postcss-loader!sass-loader!../../../apps/storybooktest/src/styles.scss';
import '../../../apps/storybooktest/src/styles.scss';
This is a simple setup, but on real project my application has dependency from material design theme, ag-grid and other global styles that i want to use when writing/testing library story.
Not sure where is the problem, am i doing something wrong, is it nx setup, storybook setup?
Current Behavior
Current behavior global style is not applied to story that was created for library component.
Expected Behavior
Steps to Reproduce
Clone repository from https://github.com/DimitriLib/storybook-test
Install dependency: npm install
Execute command: nx storybook lib-test --projectBuildConfig=storybooktest:build-storybook
Styles from apps/storybooktest that define on the application are not used in lib-test storybook even command specifies to use projectBuildConfig
This issue may not be prioritized if details are not provided to help us reproduce the issue.
Failure Logs
Environment
The text was updated successfully, but these errors were encountered: