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 <4323180+adamwathan@users.noreply.github.com>
This commit is contained in:
parent
1eab49d0b1
commit
f83041852d
2 changed files with 7 additions and 7 deletions
|
|
@ -1560,7 +1560,7 @@ test(
|
|||
`,
|
||||
'tailwind.config.js': js`module.exports = {}`,
|
||||
'src/index.css': css`
|
||||
@import 'tailwindcss/utilities';
|
||||
@import 'tailwindcss/components';
|
||||
|
||||
/* No layer expected */
|
||||
@import './my-components.css';
|
||||
|
|
@ -1571,7 +1571,7 @@ test(
|
|||
/* Expecting a layer */
|
||||
@import './my-other.css';
|
||||
|
||||
@import 'tailwindcss/components';
|
||||
@import 'tailwindcss/utilities';
|
||||
`,
|
||||
'src/my-components.css': css`
|
||||
@layer components {
|
||||
|
|
@ -1600,8 +1600,6 @@ test(
|
|||
expect(await fs.dumpFiles('./src/**/*.css')).toMatchInlineSnapshot(`
|
||||
"
|
||||
--- ./src/index.css ---
|
||||
@import 'tailwindcss/utilities' layer(utilities);
|
||||
|
||||
/* No layer expected */
|
||||
@import './my-components.css';
|
||||
|
||||
|
|
@ -1609,7 +1607,9 @@ test(
|
|||
@import './my-utilities.css';
|
||||
|
||||
/* Expecting a layer */
|
||||
@import './my-other.css' layer(utilities);
|
||||
@import './my-other.css' layer(components);
|
||||
|
||||
@import 'tailwindcss/utilities' layer(utilities);
|
||||
|
||||
--- ./src/my-components.css ---
|
||||
@utility foo {
|
||||
|
|
|
|||
|
|
@ -158,8 +158,8 @@ async function run() {
|
|||
)
|
||||
if (!importedSheet) continue
|
||||
|
||||
// Only remove the `layer(…)` next to the import, if any of the children
|
||||
// contains an `@utility`. Otherwise the `@utility` will not be top-level.
|
||||
// Only remove the `layer(…)` next to the import if any of the children
|
||||
// contain `@utility`. Otherwise `@utility` will not be top-level.
|
||||
if (
|
||||
!importedSheet.containsRule((node) => node.type === 'atrule' && node.name === 'utility')
|
||||
) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue