-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Svelte Example Components injecting global CSS #19409
Comments
ZOMG!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.1.0-alpha.14 containing PR #22162 that references this issue. Upgrade today to the
|
Jiminy cricket!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.0.10 containing PR #22162 that references this issue. Upgrade today to the
|
Thank you so much @Amerlander !! |
Describe the bug
The example components (Button, Header, Page) are adding the CSS files trough
import './header.css';
.The CSS is then Globally available and not scoped to the Component.
storybook/code/lib/cli/rendererAssets/svelte/Header.svelte
Line 3 in c745ff6
The Behavior of adding CSS through an Import is resulting in global CSS is not the Bug. Usual, most Svelte Components would not import CSS like that, and therefore I think having a Component as a sample which introduces a bad pattern and leads to side effects should be avoided.
To Reproduce
Every new installation of Storybook ads this behavior.
Additional context
There are two ways so solve that (sveltejs/svelte#7125):
I think adding css into the components will be cleaner, but it will also mean duplicating the css code for svelte.
The text was updated successfully, but these errors were encountered: