Skip to content

[v4] Inconsistent underscore #16170

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

Closed
ony3000 opened this issue Feb 2, 2025 · 1 comment · Fixed by #16206
Closed

[v4] Inconsistent underscore #16170

ony3000 opened this issue Feb 2, 2025 · 1 comment · Fixed by #16206

Comments

@ony3000
Copy link

ony3000 commented Feb 2, 2025

What version of Tailwind CSS are you using?

v4.0.3

What build tool (or framework if it abstracts the build tool) are you using?

Vite 6.0.5

What version of Node.js are you using?

v18.18.2

What browser are you using?

Chrome

What operating system are you using?

WSL

Reproduction URL

https://play.tailwindcss.com/hmN4T4wuta

Describe your issue

Hi! I'm writing a React component library that styles Joy UI components the Tailwind CSS way.

Since the existing library was written to integrate with Tailwind CSS v3, I felt the need to guide how to integrate with v4, but I found some inconsistencies in the CSS build results, so I'm reporting the issue.

Please check the generated utility class in the attached playground link.

The first two classes (h-[var(--\_root-size)] and text-[calc(0.2*var(--\_root-size))]) both use var(--\_root-size) as an arbitrary value, but in the build output one refers to --\_root-size, while the other refers to --_root-size.

When I first noticed this difference, I suspected it had to do with the presence of calc, but in the case of the third class, the backslash remains even though calc and var are nested, unlike in the second class.

The last class is a bit more unusual, as even the two --\_LinearProgress-paddings written within one class differ in the presence or absence of backslashes in the build output.

It would be nice if the presence or absence of backslashes were consistent in build results.

@philipp-spiess
Copy link
Member

Hey! Thanks for the bug report. I agree this is unexpected. We've pushed a fix for this which will be part of the next patch release. 🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants