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

Tailwindcss creates additional CSS rules when using class names with decimal fraction #13952

Closed
obecker opened this issue Jul 4, 2024 · 2 comments

Comments

@obecker
Copy link

obecker commented Jul 4, 2024

What version of Tailwind CSS are you using?

v3.4.4

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

vite 5.3.3 with postcss 8.4.39

What version of Node.js are you using?

v22.3.0

What browser are you using?

any

What operating system are you using?

macOS

Reproduction URL

https://github.com/obecker/tailwind-issue

Describe your issue

When using size/spacing classes with a decimal fraction (like m-1.5 or size-2.5) then tailwindcss will create extra (unused) rules for the corresponding classes without decimal fraction, i.e. there are also CSS rules for m-1 or size-2 like this (manually formatted for better readability):

.m-1 {
    margin: .25rem
}

.m-1\.5 {
    margin: .375rem
}

.size-2 {
    width: .5rem;
    height: .5rem
}

.size-2\.5 {
    width: .625rem;
    height: .625rem
}

I think tailwindcss should not generate these extra CSS rules.

@wongjn
Copy link
Contributor

wongjn commented Jul 4, 2024

Relevant related issue: #9354

@thecrypticace
Copy link
Contributor

thecrypticace commented Jul 5, 2024

Hi! See my response in the above mentioned issue (tl;dr this is intentional in v3): #9354 (comment)

Good news is this should be improved in v4 👍

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