style collision with chunk splitting #1163
Unanswered
taozhou-glean
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
we have been using vanilla-extract for quite some time and recently started facing some issues due to chunk splitting, which leads to style overrides.
A very simple example here:
chunk A and chunk B both have the
commonStyles.redText
class, and all styles will have the same specificity (0,0, 1, 0), so the final applied style now depend on the order in which the chunks are loaded:I am wondering if there is good suggestion to avoid such cases, what we are exploring right now is scoping every component, so instead of single class, we can wrap them with a component scope class, to make sure the component style wins over the common styles, but not sure if that's the best way forward.
Beta Was this translation helpful? Give feedback.
All reactions