File tree 2 files changed +7
-7
lines changed
packages/@tailwindcss-upgrade/src
2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -1560,7 +1560,7 @@ test(
1560
1560
` ,
1561
1561
'tailwind.config.js' : js `module .exports = {}` ,
1562
1562
'src/index.css' : css `
1563
- @import 'tailwindcss/utilities ' ;
1563
+ @import 'tailwindcss/components ' ;
1564
1564
1565
1565
/* No layer expected */
1566
1566
@import './my-components.css' ;
@@ -1571,7 +1571,7 @@ test(
1571
1571
/* Expecting a layer */
1572
1572
@import './my-other.css' ;
1573
1573
1574
- @import 'tailwindcss/components ' ;
1574
+ @import 'tailwindcss/utilities ' ;
1575
1575
` ,
1576
1576
'src/my-components.css' : css `
1577
1577
@layer components {
@@ -1600,16 +1600,16 @@ test(
1600
1600
expect ( await fs . dumpFiles ( './src/**/*.css' ) ) . toMatchInlineSnapshot ( `
1601
1601
"
1602
1602
--- ./src/index.css ---
1603
- @import 'tailwindcss/utilities' layer(utilities);
1604
-
1605
1603
/* No layer expected */
1606
1604
@import './my-components.css';
1607
1605
1608
1606
/* No layer expected */
1609
1607
@import './my-utilities.css';
1610
1608
1611
1609
/* Expecting a layer */
1612
- @import './my-other.css' layer(utilities);
1610
+ @import './my-other.css' layer(components);
1611
+
1612
+ @import 'tailwindcss/utilities' layer(utilities);
1613
1613
1614
1614
--- ./src/my-components.css ---
1615
1615
@utility foo {
Original file line number Diff line number Diff line change @@ -158,8 +158,8 @@ async function run() {
158
158
)
159
159
if ( ! importedSheet ) continue
160
160
161
- // Only remove the `layer(…)` next to the import, if any of the children
162
- // contains an `@utility`. Otherwise the `@utility` will not be top-level.
161
+ // Only remove the `layer(…)` next to the import if any of the children
162
+ // contain `@utility`. Otherwise `@utility` will not be top-level.
163
163
if (
164
164
! importedSheet . containsRule ( ( node ) => node . type === 'atrule' && node . name === 'utility' )
165
165
) {
You can’t perform that action at this time.
0 commit comments