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

Correctly migrate leading-* classes #16004

Merged
merged 3 commits into from
Jan 29, 2025
Merged

Correctly migrate leading-* classes #16004

merged 3 commits into from
Jan 29, 2025

Conversation

RobinMalfait
Copy link
Member

This PR fixes the upgrade tool by properly migrating the leading-[<number>] classes.

The issue is that leading-[<number>] maps to the number directly, but if you use a bare value, then it's a multiplier for based on the --spacing value.

E.g.:

leading-[2]:

.leading-\[2\] {
  --tw-leading: 2;
  line-height: 2;
}
@property --tw-leading {
  syntax: "*";
  inherits: false;
}

leading-2:

.leading-2 {
  --tw-leading: calc(var(--spacing) * 2);
  line-height: calc(var(--spacing) * 2);
}
@property --tw-leading {
  syntax: "*";
  inherits: false;
}

This PR will now prevent migrating arbitrary values to bare values for leading-* utilities.

That said, this does introduce a small improvement where leading-[1] is migrated to leading-none.

Fixes: #15924

@RobinMalfait RobinMalfait requested a review from a team as a code owner January 29, 2025 12:26
@RobinMalfait RobinMalfait merged commit 3da9d61 into main Jan 29, 2025
5 checks passed
@RobinMalfait RobinMalfait deleted the fix/issue-15924 branch January 29, 2025 14:22
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

Successfully merging this pull request may close these issues.

Upgrade tool incorrectly migrates leading-[1] to leading-1
2 participants