Skip to content

Commit f830418

Browse files
Handle feedback from #14783 (#14788)
This PR is a continuation of #14783 to handle the feedback on that PR. 1. Update the test to be more realistic 2. Updated the comment --------- Co-authored-by: Adam Wathan <[email protected]>
1 parent 1eab49d commit f830418

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Diff for: integrations/upgrade/index.test.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1560,7 +1560,7 @@ test(
15601560
`,
15611561
'tailwind.config.js': js`module.exports = {}`,
15621562
'src/index.css': css`
1563-
@import 'tailwindcss/utilities';
1563+
@import 'tailwindcss/components';
15641564
15651565
/* No layer expected */
15661566
@import './my-components.css';
@@ -1571,7 +1571,7 @@ test(
15711571
/* Expecting a layer */
15721572
@import './my-other.css';
15731573
1574-
@import 'tailwindcss/components';
1574+
@import 'tailwindcss/utilities';
15751575
`,
15761576
'src/my-components.css': css`
15771577
@layer components {
@@ -1600,16 +1600,16 @@ test(
16001600
expect(await fs.dumpFiles('./src/**/*.css')).toMatchInlineSnapshot(`
16011601
"
16021602
--- ./src/index.css ---
1603-
@import 'tailwindcss/utilities' layer(utilities);
1604-
16051603
/* No layer expected */
16061604
@import './my-components.css';
16071605
16081606
/* No layer expected */
16091607
@import './my-utilities.css';
16101608
16111609
/* Expecting a layer */
1612-
@import './my-other.css' layer(utilities);
1610+
@import './my-other.css' layer(components);
1611+
1612+
@import 'tailwindcss/utilities' layer(utilities);
16131613
16141614
--- ./src/my-components.css ---
16151615
@utility foo {

Diff for: packages/@tailwindcss-upgrade/src/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ async function run() {
158158
)
159159
if (!importedSheet) continue
160160

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.
163163
if (
164164
!importedSheet.containsRule((node) => node.type === 'atrule' && node.name === 'utility')
165165
) {

0 commit comments

Comments
 (0)