File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
packages/@tailwindcss-upgrade/src/codemods/config Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -992,8 +992,12 @@ test(
992992 // Automatically handled by bare values
993993 foo: 'foo="true"',
994994
995+ // Quotes are optional in CSS for these kinds of attribute
996+ // selectors
997+ bar: 'bar=true',
998+
995999 // Not automatically handled by bare values because names differ
996- bar : 'baz ="true"',
1000+ baz : 'qux ="true"',
9971001
9981002 // Completely custom
9991003 asc: 'sort="ascending"',
@@ -1018,7 +1022,7 @@ test(
10181022 --- src/input.css ---
10191023 @import 'tailwindcss';
10201024
1021- @custom-variant aria-bar (&[aria-baz ="true"]);
1025+ @custom-variant aria-baz (&[aria-qux ="true"]);
10221026 @custom-variant aria-asc (&[aria-sort="ascending"]);
10231027 @custom-variant aria-desc (&[aria-sort="descending"]);
10241028
Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ async function migrateTheme(
145145 for ( let [ key , value ] of Object . entries ( resolvedConfig . theme . aria ?? { } ) ) {
146146 // Will be handled by bare values if the names match.
147147 // E.g.: `aria-foo:flex` should produce `[aria-foo="true"]`
148- if ( new RegExp ( `^${ key } =['"]true['"] $` ) . test ( `${ value } ` ) ) continue
148+ if ( new RegExp ( `^${ key } =( ['"]?) true\\1 $` ) . test ( `${ value } ` ) ) continue
149149
150150 // Create custom variant
151151 variants . set ( `aria-${ key } ` , `&[aria-${ value } ]` )
You can’t perform that action at this time.
0 commit comments