Certainly! With TailwindCSS v4, configuration is now handled through the new tailwind.config.ts (TypeScript) or tailwind.config.js (if using JS), and customization via the CSS @plugin at-rule is not how you modify plugin options.
To customize @tailwindcss/typography in v4, you need to use the typography key in your config file, like this:
1. Open or create your tailwind.config.ts:
If you don't have one, generate it with:
npx tailwindcss init --ts
2. Customize the Typography by extending the theme:
import type { Config } from "tailwindcss";
export default {
theme: {
extend: {
typography: {
DEFAULT: {
css: {
color: "#000",
a: {
color: "#22c55e", // green-500
"&:hover": {
color: "#15803d", // green-700
},
},
"h1, h2, h3, h4, h5, h6": {
color: "#000",
},
blockquote: {
borderLeftColor: "#22c55e", // green-500
},
},
},
},
},
},
plugins: [require('@tailwindcss/typography')],
} satisfies Config;
3. Remove the @plugin directive from your CSS.
You only need to include the @tailwind directives in your CSS:
@tailwind base;
@tailwind components;
@tailwind utilities;
Summary:
- Do not use the CSS
@pluginat-rule for plugin configuration. - Use the
typographykey in your Tailwind config to customize prose styles. - Use the hex codes or CSS variables for colors since theme helpers aren't available in the CSS file.
Documentation:
See the official plugin docs for more customization details:
https://tailwindcss.com/docs/typography-plugin#customizing-the-plugin
Let me know if you need help with a specific part of your config!