Ruslan Plastun
Ruslan Plastun

Reputation: 2254

Apply CSS Reset file to Next.js page

I know about this method of injecting CSS:

import Head from 'next/head'

export default function Home() {
  return (
    <div className="container">
      <style jsx global>{`
            body {
              margin: 0;
            }
      `}</style>

      <Head>
        <title>audiom</title>
        <link rel="icon" href="/favicon.ico" />
      </Head>
      
    </div>
  )
}

But is there a way to quickly insert a css file (css reset in my case)?

Upvotes: 2

Views: 10531

Answers (1)

bcjohn
bcjohn

Reputation: 2523

You can import reset.css in _app.jsx file, it will apply css reset styles for all pages.

_app.tsx

import '../styles/reset.css';

Upvotes: 5

Related Questions