Skip to content

[v4] Dynamically generated margin, padding, width, height, etc.; does not work with decimal numbers #16229

@rozsazoltan

Description

@rozsazoltan

Note

Tailwind CSS: v4.0.3

Reproduction

<div class="w-120.5 h-120.5 bg-green-50"></div>
<div class="w-120.1 h-120.5 bg-red-50"></div>

Describe your issue

A central --spacing variable has been introduced, allowing infinite generation of margin, padding, width, height, etc.

Class Styles
m-<number> margin: calc(var(--spacing) * <number>);
-m-<number> margin: calc(var(--spacing) * -<number>);

From this, I would assume that it should accept any integer and decimal number. However, it only works perfectly with integers and .5 decimals; values like .1, .2, ... .9 do not work.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions