Replies: 5 comments 5 replies
-
There are numerous issues like this already: #12079 will cover what you are mentioning. |
Beta Was this translation helpful? Give feedback.
-
Ok I see, but with |
Beta Was this translation helpful? Give feedback.
-
So you are looking for component scoped scss? import app from '../app.module.scss'
function Index() {
return (
<div className={app.foo}>hi</div>
)
}
.foo {
background: red;
} |
Beta Was this translation helpful? Give feedback.
-
Yeah, that's pretty much what I want. But isn't there a way to do this without adding the variable as a class? |
Beta Was this translation helpful? Give feedback.
-
For anyone else that's trying to use this with dart sass' js implementation for things like
You'll then need to import your scss files in |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Bug report
All styles must be included in
_app.js
and therefore be global. I include my.scss
files, but they must be global.It seems that this tutorial is what I'm looking for, but you have to add a variable as a class to make it work, and as indicated in the post, it's no longer compatible with the new versions of Next.JS https://medium.com/@vladymyr.pylypchatin/the-simple-way-to-use-scoped-and-global-scss-with-next-js-67cdb2d0c676
I also tried
@webdeb/next-styles
but the styles are not unique to the component. They are applied by all HTML elements, even when the component is not displayed.Expected behavior
I would like to be able to use
.scss
files to be included in every component and page, so that I can use the style only when the component is rendered in the page.System information
I need help, thanks
Beta Was this translation helpful? Give feedback.
All reactions