Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

145
Visualizações
how do I import styles in a next js page

I have a styles folder in my app and it contains a file named Home.module.css.

But whenever I add this code in my pages/index.js, i get an error, the error is always the same, 404 page not found..

import styles from '../styles/Home.module.css' 

Please help me get out of this problem.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Following documentation you should just import styles without naming it:

import '.../styles/Home.module.css'

But, if you want to use varibales you can install SASS and import your styles by name:

import variables from '../styles/variables.module.scss'

export default function MyApp({ Component, pageProps }) {
  return (
    <Layout color={variables.primaryColor}>
      <Component {...pageProps} />
    </Layout>
  )
}

NOTE: pay attention to extension. If you are using SASS the extension of file should be SCSS.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda