Skip to content

Incorrect formatting of valid hyphenated values placed inside a CSS function: fit-content becomes fit - content #18219

Open
@rozsazoltan

Description

@rozsazoltan

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

<div class="min-h-[min(fit-content,calc(100dvh-4rem))]"></div>

The expected result would be:

.min-h-\[min\(fit-content\,calc\(100dvh-4rem\)\)\] {
  min-height: min(fit-content, calc(100dvh - 4rem));
}

Instead - since it's inside a min() function - every hyphen gets surrounded by spaces:

.min-h-\[min\(fit-content\,calc\(100dvh-4rem\)\)\] {
  min-height: min(fit - content, calc(100dvh - 4rem));
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions