Skip to content
Discussion options

You must be logged in to vote

I never used composeStyles but it looks like its behavior depends on where it is used:

  • when used in a *.css.ts file it will merge all styles, giving you one class name
  • when used somewhere else it will just join the class names, and not merge the styles itself

That means you now already have a lot of class names in your HTML (that is rendered in the browser), when using multiple sprinkles props and styles, right?

If yes, then you can just replace composeStyles with style whenever you are in a *.css.ts file, and use something like clsx for all other files. Your approach is actually how SEEK (the company behind vanilla-extract, I think) uses vanilla-extract for their own design system .

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@PHILLIPS71
Comment options

@rothsandro
Comment options

Answer selected by PHILLIPS71
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants