Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sensible set of fixed line-height utilities #1362

Merged
merged 1 commit into from
Feb 5, 2020

Conversation

adamwathan
Copy link
Member

This PR adds a set of fixed (not relative) line-height utilities to Tailwind by default:

Class Value
leading-3 .75rem
leading-4 1rem
leading-5 1.25rem
leading-6 1.5rem
leading-7 1.75rem
leading-8 2rem
leading-9 2.25rem
leading-10 2.5rem

These are very useful when you need fine-grained control over an element's size and the relative line-height utilities (like leading-normal) give you weird height values that are hard to work with.

A place where I ran into this myself recently is when sizing text fields with text-sm applied. A 1.5 line-height results in a text block size of 21px which just makes life hard in so many ways when trying to align things precisely.

I wrote about it in more detail in a recent Tailwind UI update email in case anyone wants the story: https://ckarchive.com/b/d0ueh0h8kl82

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant