Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

137
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!