Skip to content

Addon: CSS Resources - Possible to change order of CSS files? #1

@sander-v-bergen

Description

@sander-v-bergen

storybook_css-order
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions