-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Sort upgraded CSS #14866
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
Sort upgraded CSS #14866
Conversation
f411162 to
e3efbcd
Compare
8c55be9 to
d838c9c
Compare
e3efbcd to
6d77c8a
Compare
d4fac30 to
bff5638
Compare
45df765 to
a2a9412
Compare
packages/@tailwindcss-upgrade/src/codemods/migrate-tailwind-directives.test.ts
Outdated
Show resolved
Hide resolved
a0fa160 to
f8ce5da
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.
Let's gooo it's so good to read the diff of the integration test snapshots haha. Some comments inline, mostly not sure about the change log thing 🤔
CHANGELOG.md
Outdated
| - Ensure adjacent rules are merged together after handling nesting when generating optimized CSS ([#14873](https://github.com/tailwindlabs/tailwindcss/pull/14873)) | ||
| - _Upgrade (experimental)_: Install `@tailwindcss/postcss` next to `tailwindcss` ([#14830](https://github.com/tailwindlabs/tailwindcss/pull/14830)) | ||
| - _Upgrade (experimental)_: Remove whitespace around `,` separator when print arbitrary values ([#14838](https://github.com/tailwindlabs/tailwindcss/pull/14838)) | ||
| - _Upgrade (experimental)_: Sort upgraded CSS ([#14866](https://github.com/tailwindlabs/tailwindcss/pull/14866)) |
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.
The current message makes it sound like the order was wrong or something but the change is only really for esthetic reasons, what do you think about this? I tried to not use the word order since it has an inherent meaning in CSS and am trying to lean on the "restructure" terminology
| - _Upgrade (experimental)_: Sort upgraded CSS ([#14866](https://github.com/tailwindlabs/tailwindcss/pull/14866)) | |
| - _Upgrade (experimental)_: Restructure the generated CSS to make it easier to read ([#14866](https://github.com/tailwindlabs/tailwindcss/pull/14866)) |
Also this doesn't really fix anything so maybe it shouldn't be in the fixed category either I think 🤔
I am still not convinced this is a very good message, maybe maybe this just doesn't need a changelog entry at all haha
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.
Yeah hmm, maybe this is just an internal refactor. Especially because the codemods are not idempotent right now meaning you only will be able to run them once anyway. So it's still a single 'upgrade' and not a fix to previous upgrades from the user's perspective.
packages/@tailwindcss-upgrade/src/codemods/migrate-at-layer-utilities.ts
Outdated
Show resolved
Hide resolved
Otherwise the wrong indentation is being used.
Since this is purely an internal API, using a `@tw-` prefix reduces the chances of colliding with real user CSS.
…ilities.ts Co-authored-by: Philipp Spiess <[email protected]>
f8b30f5 to
50e4840
Compare
During the migration process, a lot of changes to the CSS file happen. Some parts are converted, some parts are deleted and some new CSS is added.
To make sure we are generating a sensible and good looking CSS file, we will sort the final CSS and pretty print it.
The order we came up with looks like this: