From a4cff3c2760ffad6efebc757520b337272bf34ff Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Sun, 8 May 2022 09:29:27 -0400 Subject: [PATCH] Add nested at-rule tests --- tests/arbitrary-variants.test.js | 62 ++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/tests/arbitrary-variants.test.js b/tests/arbitrary-variants.test.js index de77b0eea8cd..0f1453766297 100644 --- a/tests/arbitrary-variants.test.js +++ b/tests/arbitrary-variants.test.js @@ -158,6 +158,37 @@ test('at-rules', () => { }) }) +test('nested at-rules', () => { + let config = { + content: [ + { + raw: html`
`, + }, + ], + corePlugins: { preflight: false }, + } + + let input = css` + @tailwind base; + @tailwind components; + @tailwind utilities; + ` + + return run(input, config).then((result) => { + expect(result.css).toMatchFormattedCss(css` + ${defaults} + + @media screen { + @media (hover: hover) { + .\[\@media_screen\{\@media_\(hover\:hover\)\}\]\:underline { + text-decoration-line: underline; + } + } + } + `) + }) +}) + test('at-rules with selector modifications', () => { let config = { content: [{ raw: html`
` }], @@ -183,6 +214,37 @@ test('at-rules with selector modifications', () => { }) }) +test('nested at-rules with selector modifications', () => { + let config = { + content: [ + { + raw: html`
`, + }, + ], + corePlugins: { preflight: false }, + } + + let input = css` + @tailwind base; + @tailwind components; + @tailwind utilities; + ` + + return run(input, config).then((result) => { + expect(result.css).toMatchFormattedCss(css` + ${defaults} + + @media screen { + @media (hover: hover) { + .\[\@media_screen\{\@media_\(hover\:hover\)\{\&\:hover\}\}\]\:underline:hover { + text-decoration-line: underline; + } + } + } + `) + }) +}) + test('attribute selectors', () => { let config = { content: [{ raw: html`
` }],