Skip to content
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

Prevent all styles from getting loaded in Storybook #7

Closed
bmarshall511 opened this issue Jan 3, 2023 · 1 comment
Closed

Prevent all styles from getting loaded in Storybook #7

bmarshall511 opened this issue Jan 3, 2023 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@bmarshall511
Copy link
Contributor

Currently, there's 3 base styles setup: ant-design, atomic-design & wordpress

Those styles are being directly imported into the component that needs it. See the blockquote component as an example:

import "@/styles/atomic-design/style.scss";

Doing this causes those styles getting loaded globally in storybook vs. per component view. We need to load the base style conditionally based on the component that's being displayed.

The WordPress Gutenburg has done this & would like to replicate that behavior where Storybook adds a toolbar button & decorators that allow the user to select the base style that should be used. See https://github.com/WordPress/gutenberg/blob/trunk/storybook/preview.js

Tried implementing it, but was running into some issues with paths.

@bmarshall511 bmarshall511 added the documentation Improvements or additions to documentation label Jan 3, 2023
bmarshall511 added a commit that referenced this issue Jan 30, 2023
refactor(refactored blockstyle code ): refactored block code to reuse…
@bmarshall511
Copy link
Contributor Author

In progress: Entermedia-LLC#5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant