Adam Wathan aa15964b28
Use unitless line-heights for font-size variables (#15216)
Safari has an [insane
bug](https://github.com/tailwindlabs/tailwindcss/issues/15196) where if
you register custom properties for gradient colors using the `"<color>"`
type, you attempt to transition a gradient on an element, _and_ you set
a font-size and line-height on that element that point to CSS variables
defined using `rem` units, the element size changes and shifts the
layout while the transition is happening:


https://github.com/user-attachments/assets/46eefccf-8a12-4751-8a44-54e48c54cd06

This bug goes away if you use anything other than `rem` units for the
line-height. So this PR changes all of our variables like
`--text-3xl--line-height` to use unitless relative line-height values
instead of fixed line-height values to workaround this bug. Not my
favorite change but pretty low impact because you likely aren't going to
reference those variables for much anyways.

If Safari ever fixes this bug (which is still present as of Safari 18),
it would be nice to swap these back to what they were.

Fixes #15196.

---------

Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
2024-11-27 11:39:04 -05:00
..