Skip to content

Conversation

@Sidnioulz
Copy link
Member

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Nov 4, 2025

🦋 Changeset detected

Latest commit: 222e7b3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@storybook/addon-cssresources Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Sidnioulz Sidnioulz requested a review from ndelangen November 4, 2025 16:38
@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 4, 2025

Open in StackBlitz

npm i https://pkg.pr.new/storybookjs/addon-cssresources/@storybook/addon-cssresources@11

commit: 222e7b3

}

return PreviewDecorator(StoryFn, context);
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we actually still need the decorator at all?

Couldn't everything be done in a loader?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need it to react to changes in the addon panel, when users select/deselect a CSS resource.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we convert to use globals?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be an option but it would require reworking the resource list a bit. Each story should have a different set of "picked" resources (so you can write a story for your component with each major version of Bootstrap or each font you're using).

Correct me if my understanding is wrong here -> So then to use globals, we'd want stories to redefine globals, which means the parameter must be an object (so it gets merged correctly). But the parameter currently is an array, so there'd be a breaking change for users' config.

I didn't wanna invest much more effort into this addon, so I just wanted to get loaders in because it makes a decent difference visually when you load your stories. If globals is significantly more future proof or if I've missed some benefits, happy to reconsider!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants