Skip to content

Conversation

@RobinMalfait
Copy link
Member

This PR adds some improvements to the upgrade tool where it can now also migrate negative arbitrary values to negative bare values.

We already had support for the positive version of this:

- mb-[32rem]
+ mb-128

But now it can also handle negative values:

- mb-[-32rem]
+ -mb-128

The only tricky part here is that we had to hoist the - sign. Before this PR, we were actually generating mb--128 and that is invalid so it was thrown out.

Test plan

  1. Added a test to ensure that the negative values are correctly transformed.
@RobinMalfait RobinMalfait requested a review from a team as a code owner June 3, 2025 08:48
let rootPrefix = ''
if (spacingMultiplier !== null && spacingMultiplier < 0) {
rootPrefix = '-'
spacingMultiplier = Math.abs(spacingMultiplier)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also an option 🤔

Suggested change
spacingMultiplier = Math.abs(spacingMultiplier)
spacingMultiplier *= -1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants