From f195bac968e106190591605316f51cc43145fb36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Sch=C3=A4r?= Date: Thu, 15 Apr 2021 11:47:33 +0200 Subject: [PATCH] Fix media queries with jit and postcss7 (#4034) --- jit/lib/generateRules.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/jit/lib/generateRules.js b/jit/lib/generateRules.js index 74f2bc644632..86e320845710 100644 --- a/jit/lib/generateRules.js +++ b/jit/lib/generateRules.js @@ -109,7 +109,12 @@ function applyVariant(variant, matches, context) { continue } - let container = postcss.root({ nodes: [rule] }) + let container = postcss.root() + if (typeof rule.clone === 'function') { + container.append(rule.clone()) + } else { + container.append(rule) + } function modifySelectors(modifierFunction) { container.each((rule) => {