Cannot use leading-from-1.1 with @utility in Tailwind 4.1 – float values not recognized #18462
-
Hello 👋 I'm trying to create a custom utility using the new @Utility feature in Tailwind 4.1, and I'm running into an issue when using float values like 1.1. Here’s the use case:
The problem: I tried:
I understand that class names with decimals can be problematic, but Tailwind seems to accept some floats (1.25, 1.5, etc.) while silently rejecting others like 1.1 or 1.0. What I’m looking for:
Any guidance or workaround suggestions would be really appreciated 🙏 Thanks in advance for your help and for all the amazing work on Tailwind! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Your |
Beta Was this translation helpful? Give feedback.
Your
--value()
and--modifier()
parameters[*]
, mean arbitrary value[]
of any type*
. Hence, you'd need to use the arbitrary syntax with square brackets in the class name,leading-from-[1.1] leading-to-[1.25]
https://play.tailwindcss.com/7bbRbImWUm