Scope styles to a page
Heyo! I want to be able to scope some CSS to only apply when that page component is mounted. This CSS targets the
Currently I am doing
I could use
html and body tags and is not for the component itself.Currently I am doing
import "./layout.css";, which correctly applies the styles when on this page, but then the styles remain in effect when I navigate to other pages.I could use
:has() but support isn't all the way there yet. I could utilize mount and cleanup, but not sure how I could "run" and dispose of the CSS because that's not how CSS works.