Module.css
Answered
Shine posted this in #help-forum
ShineOP
Hey there, i have a quick question, is this a good way to use module.css like a normal css file ? I mean, i import my css file like that :
But in my file, i have classes like .content :
and i wanted to know if i have to put a className on my <h1> or i can do :
import styles from '/day/module.cssBut in my file, i have classes like .content :
.content {
display: flex;
align-items: center;
flex-direction: column;
}and i wanted to know if i have to put a className on my <h1> or i can do :
.content h1 {
color: red;Answered by American Chinchilla
@Shine .module.css can be treated as normal css. And as someone said above the extension is .module.css.
https://nextjs.org/docs/app/building-your-application/styling/css-modules#css-modules
https://nextjs.org/docs/app/building-your-application/styling/css-modules#css-modules
3 Replies
You can directly use .content itself
Also you need to name the file something like
I dont use module css much so im not sure but im pretty sure you need to use "module.css" as the extension
Also you need to name the file something like
day.module.cssI dont use module css much so im not sure but im pretty sure you need to use "module.css" as the extension
American Chinchilla
@Shine .module.css can be treated as normal css. And as someone said above the extension is .module.css.
https://nextjs.org/docs/app/building-your-application/styling/css-modules#css-modules
https://nextjs.org/docs/app/building-your-application/styling/css-modules#css-modules
Answer
@American Chinchilla <@469208754047418378> .module.css can be treated as normal css. And as someone said above the extension is .module.css.
https://nextjs.org/docs/app/building-your-application/styling/css-modules#css-modules
ShineOP
Yes, i know it's
And okay, just wanted to know if i could directly call component <button> without problem so thx mate
something.module.css, just missclicked while typing the code.And okay, just wanted to know if i could directly call component <button> without problem so thx mate