Skip to content

Commit

Permalink
Ensure @apply of a utility with multiple definitions works (#5870)
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinMalfait authored Oct 25, 2021
1 parent de1bdb4 commit 1218b3e
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions tests/apply.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`<div class="foo"></div>` }],
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;
}
`)
})
})

0 comments on commit 1218b3e

Please sign in to comment.