File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
packages/@tailwindcss-upgrade/src/codemods/config Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -1018,6 +1018,13 @@ test(
1018
1018
--- src/input.css ---
1019
1019
@import 'tailwindcss';
1020
1020
1021
+ /*
1022
+ These variants have been migrated from your Tailwind CSS configuration file.
1023
+ Since they are custom variants, they will be sorted after all built-in variants.
1024
+
1025
+ This may result in elements appearing different if you were relying on the order of
1026
+ the variants in the CSS.
1027
+ */
1021
1028
@custom-variant aria-bar (&[aria-baz="true"]);
1022
1029
@custom-variant aria-asc (&[aria-sort="ascending"]);
1023
1030
@custom-variant aria-desc (&[aria-sort="descending"]);
Original file line number Diff line number Diff line change 1
1
import { Scanner } from '@tailwindcss/oxide'
2
+ import dedent from 'dedent'
2
3
import fs from 'node:fs/promises'
3
4
import path from 'node:path'
4
5
import { fileURLToPath } from 'node:url'
@@ -223,6 +224,17 @@ async function migrateTheme(
223
224
224
225
if ( variants . size > 0 ) {
225
226
css += '\n@tw-bucket custom-variant {\n'
227
+
228
+ css += dedent `
229
+ /*
230
+ These variants have been migrated from your Tailwind CSS configuration file.
231
+ Since they are custom variants, they will be sorted after all built-in variants.
232
+
233
+ This may result in elements appearing different if you were relying on the order of
234
+ the variants in the CSS.
235
+ */
236
+ `
237
+
226
238
for ( let [ name , selector ] of variants ) {
227
239
css += `@custom-variant ${ name } (${ selector } );\n`
228
240
}
You can’t perform that action at this time.
0 commit comments