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

Migrate default utilities to have a value suffix #14875

Merged
merged 5 commits into from
Nov 6, 2024

Conversation

RobinMalfait
Copy link
Member

This PR adds a migration for migrating the changes we implemented in #14849

This is the migration we perform:

Old New
shadow shadow-sm
shadow-sm shadow-xs
shadow-xs shadow-2xs
inset-shadow inset-shadow-sm
inset-shadow-sm inset-shadow-xs
inset-shadow-xs inset-shadow-2xs
drop-shadow drop-shadow-sm
drop-shadow-sm drop-shadow-xs
rounded rounded-sm
rounded-sm rounded-xs
blur blur-sm
blur-sm blur-xs

Also added an integration test to ensure that shadow is properly migrated to shadow-sm, and doesn't get migrated to shadow-xs (because shadow-sm is migrated to shadow-xs).

@RobinMalfait RobinMalfait requested a review from a team as a code owner November 5, 2024 14:44
@RobinMalfait RobinMalfait force-pushed the feat/migrate-shadow-radius-blur-defaults branch 2 times, most recently from 5e33444 to bd34125 Compare November 5, 2024 16:50
Copy link
Member

@philipp-spiess philipp-spiess left a comment

Choose a reason for hiding this comment

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

LGTM just some bike shedding on the change log entry 😄 Feel free to use this feedback at your own discretion. I'll stamp this, we can always tweak the changelog before the release.

CHANGELOG.md Outdated
- _Upgrade (experimental)_: Support migrating projects with multiple config files ([#14863](https://github.com/tailwindlabs/tailwindcss/pull/14863))
- _Upgrade (experimental)_: Rename default utilities (such `shadow`, `blur` and `rounded`) to have a value prefix ([#14875](https://github.com/tailwindlabs/tailwindcss/pull/14875))
Copy link
Member

Choose a reason for hiding this comment

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

"to have a value prefix" isn't clear (also I think you mean suffix here?)

Maybe we can reference the changed section in the changelog here somehow (.. rename shadow, inset-shadow, drop-shadow, rounded, and blur utilities in accordance with the changes made in this version) it's clearer to what we do (or even repeat the exact examples that we have for drop-shdow to drop-shadow-sm etc.

Copy link
Member Author

Choose a reason for hiding this comment

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

I did mean suffix, oops. How about this:

caafd6a

Copy link
Member

Choose a reason for hiding this comment

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

Yeah I think this is the clearest, albeit a bit verbose 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

That's exactly what we did in the PR where we introduced these changes, so just used that as a reference. d1724fd

@RobinMalfait RobinMalfait changed the title Migrate default utilities to have a value prefix Migrate default utilities to have a value suffix Nov 6, 2024
This is to ensure that we migrate `blur` to `blur-sm`, and don't migrate
again, because then this would be converted to `blur-xs` and that's not
what we want.
@RobinMalfait RobinMalfait force-pushed the feat/migrate-shadow-radius-blur-defaults branch from 81606c9 to caafd6a Compare November 6, 2024 11:15
@RobinMalfait RobinMalfait merged commit d099f8b into next Nov 6, 2024
1 check passed
@RobinMalfait RobinMalfait deleted the feat/migrate-shadow-radius-blur-defaults branch November 6, 2024 11:28
RobinMalfait added a commit that referenced this pull request Nov 14, 2024
This PR fixes an issue where we migrated classes such as `rounded` to
`rounded-sm` (see:
#14875)

However, if you override the values in your `tailwind.config.js` file,
then the migration might not be correct.

This PR makes sure to only migrate the classes if you haven't overridden
the values in your `tailwind.config.js` file.

---------

Co-authored-by: Philipp Spiess <hello@philippspiess.com>
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.

2 participants