add test to prove @supports is kept in @layer rule (#5992)

This commit is contained in:
Robin Malfait 2021-11-05 15:12:35 +01:00 committed by GitHub
parent 79e3e098d2
commit 7eabb74bec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -299,3 +299,40 @@ test('layers are grouped and inserted at the matching @tailwind rule', () => {
`)
})
})
it('should keep `@supports` rules inside `@layer`s', () => {
let config = {
content: [{ raw: html`<div class="test"></div>` }],
plugins: [],
}
let input = css`
@tailwind utilities;
@layer utilities {
.test {
--tw-test: 1;
}
@supports (backdrop-filter: blur(1px)) {
.test {
--tw-test: 0.9;
}
}
}
`
return run(input, config).then((result) => {
return expect(result.css).toMatchFormattedCss(css`
.test {
--tw-test: 1;
}
@supports (backdrop-filter: blur(1px)) {
.test {
--tw-test: 0.9;
}
}
`)
})
})