Scope CSS side effect to route? #8994
Unanswered
aaronadamsCA
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
Uh oh!
There was an error while loading. Please reload this page.
-
With Vite, I was hoping I could create a
route.css
file for one route:Import it as a side effect in that route:
And have it only affect that route.
In reality, the Vite dev server leaves these styles in place after navigating away from the route.
Is this a bug, or just a limitation of the dev server and/or side-effect imports? Because I would love to be able to scope CSS like this, I'm just not sure if this is meant to work or not.
Beta Was this translation helpful? Give feedback.
All reactions