iTranslated by AI
The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
📌
Fixing Transparent Buttons when using Tailwind CSS with Next.js and Ant Design
Conclusion
tailwind.config.js
corePlugins: { //Added
preflight: false
}
Situation
-
Next13
- Tailwind CSS added by default
-
Ant Design added as per the Docs
pages/index.tsx
import Image from 'next/image'
import { Button } from 'antd'
export default function Home() {
return (
<>
<h1>Hello World</h1>
<div>
<Button size="large" type="primary">
Button
</Button>
</div>
</>
);
}

As shown here, the button becomes transparent.
Solution

tailwind.config.js
plugins: [],
corePlugins: { //Added
preflight: false
}
}
Add the corePlugins setting. It seems to be explained in the following video as well. It appears to disable Tailwind CSS's style reset.
Reference
Discussion