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(
10181018 --- src/input.css ---
10191019 @import 'tailwindcss';
10201020
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+ */
10211028 @custom-variant aria-bar (&[aria-baz="true"]);
10221029 @custom-variant aria-asc (&[aria-sort="ascending"]);
10231030 @custom-variant aria-desc (&[aria-sort="descending"]);
Original file line number Diff line number Diff line change 11import { Scanner } from '@tailwindcss/oxide'
2+ import dedent from 'dedent'
23import fs from 'node:fs/promises'
34import path from 'node:path'
45import { fileURLToPath } from 'node:url'
@@ -223,6 +224,17 @@ async function migrateTheme(
223224
224225 if ( variants . size > 0 ) {
225226 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+
226238 for ( let [ name , selector ] of variants ) {
227239 css += `@custom-variant ${ name } (${ selector } );\n`
228240 }
You can’t perform that action at this time.
0 commit comments