-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Ensure upgrade tool has access to a JS config #14597
Conversation
b94aefe
to
51ef4e6
Compare
// Migrate the important modifier to the end of the utility | ||
if (utility[0] === '!') { | ||
utility = `${utility.slice(1)}!` | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this on purpose or was this a leftover from another PR? Seems unrelated to this PR at first but just checking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was on purpose, we don't need to move the important modified at the end inside this loop anymore, now that we always have a config and always run the candidate migrations => The candidate migration will take care of this.
0ad61df
to
c012f15
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! While testing I did notice we have a bogus import still. But apart from this this seems to work as expected!
Co-authored-by: Robin Malfait <[email protected]>
@RobinMalfait haha whoops 🙈 |
In order to properly migrate your Tailwind CSS v3 project to v4, we need access to the JavaScript configuration object. This was previously only required for template migrations, but in this PR we're making it so that this is also a prerequisite of the CSS migrations. This is because some migrations, like
@apply
, also need to convert candidates that to the v4 syntax and we need the full config in order to properly validate them.In addition to requiring a JS config, we also now attempt to automatically find the right configuration file inside the current working directory. This is now matching the behavior of the Tailwind CSS v3 CLI where it will find the config automatically if it's in the current directory and called
tailwind.conf.js
.