How can i link my tailwindcss to next.js repo
Answered
lun ツ posted this in #help-forum
lun ツOP
i have tailwindcss.config.js,postcss.config.js,but it didnt works
23 Replies
lun ツOP
tailwind.config.js
postcss.config.js
next.config.js
../pages/index.tsx
but u just dont know why h1 element didnt change color and font-size
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
"./pages/**/*.{js,ts,jsx,tsx}",
"./components/**/*.{js,ts,jsx,tsx}"
],
theme: {
extend: {},
},
plugins: [],
};postcss.config.js
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}next.config.js
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
}
module.exports = nextConfig../pages/index.tsx
import type { NextPage } from 'next'
import Head from 'next/head'
const Home: NextPage = () => {
return (
<div>
<Head>
<title>VALLIANTY</title>
</Head>
<h1 className='p-10 text-red-500'>test</h1>
</div>
)
}
export default Homebut u just dont know why h1 element didnt change color and font-size
iirc
postcss.config.css should be postcss.config.jshe probably had typo IG
@lun ツ restart the dev server
Answer
delete .next
Nah wait the author to describe more about his issue, he didn't said tailwind css not working, but instead
h1 element didnt change color and font-size
Tailwind CSS does a [Preflight](https://tailwindcss.com/docs/preflight), it resets the default styles of heading elements. You have to do:
So that you can get the same look cross browsers/platforms
<h1 className="text-xl">Hello World</h1>So that you can get the same look cross browsers/platforms
@lun ツ U followed all steps? in that guide
@dumbboy <@1038029376924688394> U followed all steps? in that guide
lun ツOP
i think yes
i read the documents the whole night yesterday
i read the documents the whole night yesterday
alright restart magic 

the old saying
have you tried turning it on and off againlun ツOP

lun ツOP
thank u guys~~

