You can create custom color themes for the typography plugin using either CSS @utility directives or the Tailwind JavaScript configuration.
Using CSS @utility (Recommended for modern setups)
Add a @utility directive to your CSS file to define a new theme (e.g., prose-pink) by mapping internal typography CSS variables to your desired colors.
Using Tailwind JavaScript Config (Tailwind v3)
Update the typography section in your tailwind.config.js and provide your colors under the css key. This allows you to define named themes like pink that can be used as prose-pink.
/* CSS @utility approach */
@utility prose-pink {
--tw-prose-body: var(--color-pink-800);
--tw-prose-headings: var(--color-pink-900);
/* ... other variables */
}
// tailwind.config.js approach
/** @type {import('tailwindcss').Config} */
module.exports = {
theme: {
extend: {
typography: () => ({
pink: {
css: {
'--tw-prose-body': 'var(--color-pink-800)',
'--tw-prose-headings': 'var(--color-pink-900)',
// ...
},
},
}),
},
},
}