I'm currently working on a project that includes the following files:
/* styles/1.scss */
body {
/* Some other styles not related to background-color */
}
/* styles/2.scss */
body {
background-color: blue;
}
// pages/one.js
import "../styles/1.scss";
export default ()=>(
<div>Hello, One!</div>
)
Upon visiting localhost:3000/one
, I noticed that the background turns blue even though no style for background-color
is defined in 1.scss
!
I suspect this issue might be related to css modules, so I attempted wrapping 2.scss
with :local
.
I also tried renaming 2.scss
to 2.module.scss
, but it did not fix the problem.
Any suggestions on how to resolve this? I appreciate your assistance!
Edit: You can view this issue on codesandbox: https://codesandbox.io/s/priceless-flower-oswh1
If the background color is not orange, try clicking "Go to two" and then return to one. The orange background will persist.