Skip to content

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

Closed
@obecker

Description

@obecker

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.

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