0

I've set up tailwind css for my project with next js v12. I've set up purging and file imports accordingly and it should style the components/pages correctly. However.. It doesn't. No errors or anything. But when I rollback to Next JS v11, the styling gets applied when I don't change any code. I'm failing to understand why this is an issue for me as it seems it's not a common issue.

tailwind.config.js

module.exports = {
  mode: 'jit',
  purge: ['./pages/**/*.{js,ts,jsx,tsx}', './components/**/*.{js,ts,jsx,tsx}'],
  darkMode: 'false', // or 'media' or 'class'
  theme: {
    extend: {},
  },
  variants: {
    extend: {},
  },
  plugins: [],
}

globals.css

@tailwind base;
@tailwind components;
@tailwind utilities;


@layer base {
  html,
  body {
    padding: 0;
    margin: 0;
  }
  
}

_app.tsx

import "../styles/globals.css";
import "tailwindcss/tailwind.css";

import type { AppProps } from 'next/app'

function MyApp({ Component, pageProps }: AppProps) {
  return <Component {...pageProps} />
}

export default MyApp

1 Answer 1

0

I forgot to restart my damn application for the config to compile when I made changes to it.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.