From 5a6a3f11e2f4fe915d3934d6cb928ac3c18a4cd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Sch=C3=A4r?= Date: Fri, 23 Apr 2021 19:59:36 +0200 Subject: [PATCH] Fix media queries with jit and postcss7 (#4034) (#4078) --- 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) => {