solidjs / solid-router

A universal router for Solid inspired by Ember and React Router
MIT License
1.14k stars 147 forks source link

CSS being applied to pages that do not import it #325

Closed SomeAspy closed 10 months ago

SomeAspy commented 10 months ago

Describe the bug

I could just be improperly using the router application, but this seems like a bug. loading/preloading a page will apply it's CSS to the page you are currently on, or carry over, despite that page not importing the CSS.

Your Example Website or App

https://stackblitz.com/edit/solidjs-templates-ddkxtj

Steps to Reproduce the Bug or Issue

  1. Load CSS on another page
  2. Link to that page
  3. Hovering or clicking the link and going back will apply the second page's CSS to the first page

Expected behavior

Another page's CSS should not be applied to the current page when loading another page.

Screenshots or Videos

https://github.com/solidjs/solid-router/assets/33640860/62474034-1e00-4791-95f1-b73402b09ac6

Platform

Additional context

No response

SomeAspy commented 10 months ago

My bad, after discussing this with friends, they mentioned this is intended behavior. I wasn't able to find anything on this, but perhaps I'm just bad at googling :^)