Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.scss styles leaking to other pages #10609

Closed
JayJohn1869 opened this issue Feb 20, 2020 · 2 comments
Closed

.scss styles leaking to other pages #10609

JayJohn1869 opened this issue Feb 20, 2020 · 2 comments

Comments

@JayJohn1869
Copy link

The bug

When styling components for one page, (eg. div), the style leaks to other pages (ie. all divs on other pages are styled as well)

To Reproduce

Visit my codesandbox which contains minimal code to exhibit this behavior

  1. Go to /one
  2. Click "go to two"
  3. Click "go to one"

Notice that the background-color style from 2.scss has persisted.

Expected behavior

I expect that changing the path with remove any styles that are not needed for that page. Notice that even if you hard refresh /one, the orange background remains. In other words, styles from 2.scss are "leaking" into 1.scss and thus into /one

System information

  • OS: Linux
  • Browser (if applies) Chrome
  • Version of Next.js: 9.2.3-canary.6

Thanks for your help!

@JayJohn1869 JayJohn1869 changed the title .scss styles leaking to wrong pages .scss styles leaking to other pages Feb 20, 2020
@timneutkens
Copy link
Member

timneutkens commented Feb 20, 2020

This is no longer the case when #10134 lands on stable. Reason it currently happens is that you're using global styles using next-sass (which will be obsolete when built-in support lands).

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants