Skip to content

Commit 7eabb74

Browse files
authored
add test to prove @supports is kept in @layer rule (tailwindlabs#5992)
1 parent 79e3e09 commit 7eabb74

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

tests/layer-at-rules.test.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,3 +299,40 @@ test('layers are grouped and inserted at the matching @tailwind rule', () => {
299299
`)
300300
})
301301
})
302+
303+
it('should keep `@supports` rules inside `@layer`s', () => {
304+
let config = {
305+
content: [{ raw: html`<div class="test"></div>` }],
306+
plugins: [],
307+
}
308+
309+
let input = css`
310+
@tailwind utilities;
311+
312+
@layer utilities {
313+
.test {
314+
--tw-test: 1;
315+
}
316+
317+
@supports (backdrop-filter: blur(1px)) {
318+
.test {
319+
--tw-test: 0.9;
320+
}
321+
}
322+
}
323+
`
324+
325+
return run(input, config).then((result) => {
326+
return expect(result.css).toMatchFormattedCss(css`
327+
.test {
328+
--tw-test: 1;
329+
}
330+
331+
@supports (backdrop-filter: blur(1px)) {
332+
.test {
333+
--tw-test: 0.9;
334+
}
335+
}
336+
`)
337+
})
338+
})

0 commit comments

Comments
 (0)