How to customize Tailwind Typography plugin
April 9, 2021
You can customize the styles applied by the @tailwindcss/typography
plugin in your tailwind.config.js
file:
// tailwind.config.js
module.exports = {
theme: {
extend: {
typography: theme => ({
DEFAULT: {
css: {
color: theme('colors.blue.500'),
textDecoration: 'none'
}
}
}
}
},
plugins: [
require('@tailwindcss/typography')
]
}
The theme
helper function lets you access values from your Tailwind config. I find it helpful to reference the default Tailwind config when using this helper.
It’s also helpful to reference the default Tailwind typography config to figure out what you want to override.
Subscribe to my newsletter!
A weekly round-up of new blog posts and updates to projects I’m working on.