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"',
@@ -1025,7 +1029,7 @@ test(
10251029 This may result in elements appearing different if you were relying on the order of
10261030 the variants in the CSS.
10271031 */
1028- @custom-variant aria-bar (&[aria-baz ="true"]);
1032+ @custom-variant aria-baz (&[aria-qux ="true"]);
10291033 @custom-variant aria-asc (&[aria-sort="ascending"]);
10301034 @custom-variant aria-desc (&[aria-sort="descending"]);
10311035
Original file line number Diff line number Diff line change @@ -146,7 +146,7 @@ async function migrateTheme(
146146 for ( let [ key , value ] of Object . entries ( resolvedConfig . theme . aria ?? { } ) ) {
147147 // Will be handled by bare values if the names match.
148148 // 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
150150
151151 // Create custom variant
152152 variants . set ( `aria-${ key } ` , `&[aria-${ value } ]` )
You can’t perform that action at this time.
0 commit comments