-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Incorrect formatting of valid hyphenated values placed inside a CSS function: fit-content
becomes fit - content
#18219
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
Comments
tailwindcss/packages/tailwindcss/src/utils/math-operators.ts Lines 110 to 136 in f425720
|
RobinMalfait
added a commit
that referenced
this issue
Jun 10, 2025
Fixes #18219 ## Summary In an arbitrary value, if there's a non-numeric character both before and after a hyphen, there's no need for a space. ## Test plan `decodeArbitraryValue` will correctly format special CSS values like `fit-content`. I believe spaces are only necessary if there's a digit either before or after the hyphen. ```js decodeArbitraryValue('min(fit-content,calc(100dvh-4rem))') ``` This way, the result of the following arbitrary value will also be correct: ```html <div class="min-h-[min(fit-content,calc(100dvh-4rem))]"></div> ``` ```css .min-h-\[min\(fit-content\,calc\(100dvh-4rem\)\)\] { min-height: min(fit-content, calc(100dvh - 4rem)); } ``` --------- Co-authored-by: Jordan Pittman <[email protected]> Co-authored-by: Robin Malfait <[email protected]>
Hey! This has been fixed (by you actually) by #18220 and will be available in the next release. Thanks again! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What version of Tailwind CSS are you using?
For example: v4.1.8
What build tool (or framework if it abstracts the build tool) are you using?
Tailwind Play
Reproduction URL
https://play.tailwindcss.com/kbBgEMHTsM
Describe your issue
The expected result would be:
Instead - since it's inside a
min()
function - every hyphen gets surrounded by spaces:The text was updated successfully, but these errors were encountered: