Skip to content
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

Small bug on negative 0.5 classes (like "-left-0.5") #13782

Closed
eloyesp opened this issue Jun 3, 2024 · 2 comments
Closed

Small bug on negative 0.5 classes (like "-left-0.5") #13782

eloyesp opened this issue Jun 3, 2024 · 2 comments

Comments

@eloyesp
Copy link
Contributor

eloyesp commented Jun 3, 2024

When using 0.5 as negative value, tailwind generates "-foo-0" as an extra class on the generated css.

Here is the reproduction of the issue on play: https://play.tailwindcss.com/5zq4jfVadZ using v3.4.3

<div class="fixed -inset-0.5 -left-0.5">Hy</div>

And the generated css ends with:

.-inset-0 {
  inset: -0px;
}
.-inset-0\.5 {
  inset: -0.125rem;
}
.-left-0 {
  left: -0px;
}
.-left-0\.5 {
  left: -0.125rem;
}

It is not a big bug in this case, just two extra lines on the css, but may be it have other escenarios with a bigger impact. Regards.

@barvian
Copy link
Contributor

barvian commented Jun 3, 2024

I just ran into this too. It looks like it's a known limitation: #9354 (comment)

@adamwathan
Copy link
Member

Yeah unfortunately this is a limitation of the regex-based JS parser in v3 as mentioned in the linked comment. The good news is that the v4 parser handles this better and won't pick up -left-0 👍

Going to close this one since it's an intentional trade-off but will be better in the future!

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

No branches or pull requests

3 participants