From 7b7a5ea4c820473a3a381b9ae267856ac939c08a Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Mon, 25 Oct 2021 11:31:54 +0200 Subject: [PATCH] ensure `@apply` of a utility with multiple definitions works --- tests/apply.test.js | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/tests/apply.test.js b/tests/apply.test.js index 02be6d633911..dd899febc4c8 100644 --- a/tests/apply.test.js +++ b/tests/apply.test.js @@ -428,3 +428,40 @@ it('should remove duplicate properties when using apply with similar properties' `) }) }) + +it('should apply all the definitions of a class', () => { + let config = { + content: [{ raw: html`
` }], + plugins: [], + } + + let input = css` + @tailwind components; + @tailwind utilities; + + @layer utilities { + .aspect-w-1 { + position: relative; + } + + .aspect-w-1 { + --tw-aspect-w: 1; + } + } + + @layer components { + .foo { + @apply aspect-w-1; + } + } + ` + + return run(input, config).then((result) => { + return expect(result.css).toMatchFormattedCss(css` + .foo { + position: relative; + --tw-aspect-w: 1; + } + `) + }) +})