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"',
@@ -1025,7 +1029,7 @@ test(
1025
1029
This may result in elements appearing different if you were relying on the order of
1026
1030
the variants in the CSS.
1027
1031
*/
1028
- @custom-variant aria-bar (&[aria-baz ="true"]);
1032
+ @custom-variant aria-baz (&[aria-qux ="true"]);
1029
1033
@custom-variant aria-asc (&[aria-sort="ascending"]);
1030
1034
@custom-variant aria-desc (&[aria-sort="descending"]);
1031
1035
Original file line number Diff line number Diff line change @@ -146,7 +146,7 @@ async function migrateTheme(
146
146
for ( let [ key , value ] of Object . entries ( resolvedConfig . theme . aria ?? { } ) ) {
147
147
// Will be handled by bare values if the names match.
148
148
// E.g.: `aria-foo:flex` should produce `[aria-foo="true"]`
149
- if ( new RegExp ( `^${ key } =['"]true['"] $` ) . test ( `${ value } ` ) ) continue
149
+ if ( new RegExp ( `^${ key } =( ['"]?) true\\1 $` ) . test ( `${ value } ` ) ) continue
150
150
151
151
// Create custom variant
152
152
variants . set ( `aria-${ key } ` , `&[aria-${ value } ]` )
You can’t perform that action at this time.
0 commit comments