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(
992
992
// Automatically handled by bare values
993
993
foo: 'foo="true"',
994
994
995
+ // Quotes are optional in CSS for these kinds of attribute
996
+ // selectors
997
+ bar: 'bar=true',
998
+
995
999
// Not automatically handled by bare values because names differ
996
- bar : 'baz ="true"',
1000
+ baz : 'qux ="true"',
997
1001
998
1002
// Completely custom
999
1003
asc: 'sort="ascending"',
@@ -1018,7 +1022,7 @@ test(
1018
1022
--- src/input.css ---
1019
1023
@import 'tailwindcss';
1020
1024
1021
- @custom-variant aria-bar (&[aria-baz ="true"]);
1025
+ @custom-variant aria-baz (&[aria-qux ="true"]);
1022
1026
@custom-variant aria-asc (&[aria-sort="ascending"]);
1023
1027
@custom-variant aria-desc (&[aria-sort="descending"]);
1024
1028
Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ async function migrateTheme(
145
145
for ( let [ key , value ] of Object . entries ( resolvedConfig . theme . aria ?? { } ) ) {
146
146
// Will be handled by bare values if the names match.
147
147
// 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
149
149
150
150
// Create custom variant
151
151
variants . set ( `aria-${ key } ` , `&[aria-${ value } ]` )
You can’t perform that action at this time.
0 commit comments