Specify a default line-height for each font-size in Tailwind CSS
•
Tailwind 1.3 added the ability to specify a line-height for each font-size in your config file.
The following example sets the base font-size to 1rem
, and the line-height to 1.5
.
// tailwind.config.js
module.exports = {
theme: {
fontSize: {
base: ['1rem', '1.5'],
},
},
}
Say goodbye to fiddling with leading-*
classes in your markup.
Sign up for my newsletter
A monthly round-up of blog posts, projects, and internet oddments.