-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
In Tailwind v4 line heights can be defined as css calc() which breaks
Hacky patch that fixes it
diff --git a/dist/utilities.js b/dist/utilities.js
index a5cad611fbd540ba01cf42d7ac3d9d6d2adf2514..38a5f7fe3c5e8ef6b5117db9765914cd5b4cd484 100644
--- a/dist/utilities.js
+++ b/dist/utilities.js
@@ -79,7 +79,11 @@ function round(value) {
* custom property.
*/
function lineHeightProperties(lineHeight, rootSize = 16) {
- let lineHeightActual = isRelativeValue(lineHeight)
+ let isCssFunction = /^(calc)\s*\(/i.test(lineHeight)
+
+ let lineHeightActual = isCssFunction ?
+ `calc((${lineHeight}) * var(--font-size-px))`
+ : isRelativeValue(lineHeight)
? `calc(${getRelativeValue(lineHeight).toString()} * var(--font-size-px))`
: normalizeValue(lineHeight, rootSize).toString();
return {
stormwarning
Metadata
Metadata
Assignees
Labels
No labels