Global CSS in sublayout / page affects everything
Answered
Colombian fino hound posted this in #help-forum
Colombian fino houndOP
If I import a css in a subroute layout.tsx (or page.tsx), it's there forever, even when going to a different route.
This also applies when I add import of the css onto a child page.tsx, if I navigate back, the css file is still there... Is this preventable?
This also applies when I add import of the css onto a child page.tsx, if I navigate back, the css file is still there... Is this preventable?
Answered by riský
im pretty sure css modules can be used just to limit import scope and use like before, but i might be wrong
4 Replies
using css modules
Colombian fino houndOP
yeah, I know. Problem is that one part of our app is bound to global, old-school, css and needs to be loaded. Which is fine, as long as I can prevent it from being stuck navigating to parts of the app that's using css modules
im pretty sure css modules can be used just to limit import scope and use like before, but i might be wrong
Answer
but otherwise this is kinda why i use tailwind - there are solutions for your poblem but i can't think of them at the top of my head