I'm using 'CSS Resources' to switch between different (global) CSS files.
This has been set-up in the preview.js and is working as expected.
There is one issue I can't solve:
The CSS file from the 'CSS Resources' addon is loaded after the story specific CSS.
This results in story specific styling being overwritten by the global CSS.
Example:
cssresources is loading bootstrap.css.
Button.stories.js is loading its own CSS file Button.css to overwrite specific styles.
Due to the order of the CSS files being loaded in the DOM this isn't working.
Is there a way to control the order of the CSS files? So the story specific CSS always loads after global / cssresources CSS files? Thanks!
Information:
@storybook/react version 6.2.9@storybook/addon-cssresources version 6.2.9
I'm using 'CSS Resources' to switch between different (global) CSS files. This has been set-up in the
preview.js
and is working as expected.There is one issue I can't solve: The CSS file from the 'CSS Resources' addon is loaded after the story specific CSS. This results in story specific styling being overwritten by the global CSS.
Example:
cssresources
is loadingbootstrap.css
.Button.stories.js
is loading its own CSS fileButton.css
to overwrite specific styles. Due to the order of the CSS files being loaded in the DOM this isn't working.Is there a way to control the order of the CSS files? So the story specific CSS always loads after global / cssresources CSS files? Thanks!
Information:
@storybook/react
version6.2.9
@storybook/addon-cssresources
version6.2.9