Skip to content

Is there a way to make Sprinkles tree-shakeable #1237

Answered by askoufis
Ghirigoro asked this question in Q&A
Discussion options

You must be logged in to vote

It's quite a tricky problem to statically analyze which sprinkles classes are used and not used, and is somewhat outside the realm of what Vanilla Extract is currently capable of.

I would suggest that it's worth evaluating which utility classes actually need conditions on them. It makes sense to have media query conditions for space properties, but is it worth having a :focus condition for space properties? IMO probably not.

Another thing worth considering is whether it would just be easier to have static styles for a subset of your vars. For example, if you only want to allow a subset of colors to be available for :focus styles, rather than using sprinkles you could just create some stat…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Ghirigoro
Comment options

Answer selected by Ghirigoro
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