Skip to content

Commit 1218b3e

Browse files
authored
Ensure @apply of a utility with multiple definitions works (#5870)
1 parent de1bdb4 commit 1218b3e

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

tests/apply.test.js

+37
Original file line numberDiff line numberDiff line change
@@ -428,3 +428,40 @@ it('should remove duplicate properties when using apply with similar properties'
428428
`)
429429
})
430430
})
431+
432+
it('should apply all the definitions of a class', () => {
433+
let config = {
434+
content: [{ raw: html`<div class="foo"></div>` }],
435+
plugins: [],
436+
}
437+
438+
let input = css`
439+
@tailwind components;
440+
@tailwind utilities;
441+
442+
@layer utilities {
443+
.aspect-w-1 {
444+
position: relative;
445+
}
446+
447+
.aspect-w-1 {
448+
--tw-aspect-w: 1;
449+
}
450+
}
451+
452+
@layer components {
453+
.foo {
454+
@apply aspect-w-1;
455+
}
456+
}
457+
`
458+
459+
return run(input, config).then((result) => {
460+
return expect(result.css).toMatchFormattedCss(css`
461+
.foo {
462+
position: relative;
463+
--tw-aspect-w: 1;
464+
}
465+
`)
466+
})
467+
})

0 commit comments

Comments
 (0)