Skip to content

Upgrade tool incorrectly migrates leading-[1] to leading-1 #15924

@RobinMalfait

Description

@RobinMalfait

The @tailwindcss/upgrade tool incorrectly migrates leading-[1] to leading-1.

The leading utility supports bare values that map to a value directly, e.g.:

leading-123

/*! tailwindcss v4.0.0 | MIT License | https://tailwindcss.com */
.leading-123 {
  --tw-leading: calc(var(--spacing) * 123);
  line-height: calc(var(--spacing) * 123);
}
@property --tw-leading {
  syntax: "*";
  inherits: false;
}

However, some values exist in your @theme, such as leading-1, which maps to:

/*! tailwindcss v4.0.0 | MIT License | https://tailwindcss.com */
.leading-1 {
  --tw-leading: calc(var(--spacing) * 1);
  line-height: calc(var(--spacing) * 1);
}
@property --tw-leading {
  syntax: "*";
  inherits: false;
}

Which is now equivalent to 4px instead of 1 which makes this transformation unsafe.

Thanks @JeroenReumkens!

Metadata

Metadata

Assignees

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