Skip to content

Commit

Permalink
Fix media queries for postcss7 (#4695)
Browse files Browse the repository at this point in the history
This fixes a postcss7 issues where .append() does not clear the children
  • Loading branch information
RobinMalfait committed Jun 18, 2021
1 parent 70ca673 commit 0b6176b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/util/pluginUtils.js
Expand Up @@ -82,7 +82,9 @@ export function transformAllSelectors(transformSelector, { wrap, withRule } = {}

if (wrap) {
let wrapper = wrap()
wrapper.append(container.nodes)
let nodes = container.nodes
container.removeAll()
wrapper.append(nodes)
container.append(wrapper)
}
}
Expand All @@ -102,7 +104,9 @@ export function transformAllClasses(transformClass, { wrap, withRule } = {}) {

if (wrap) {
let wrapper = wrap()
wrapper.append(container.nodes)
let nodes = container.nodes
container.removeAll()
wrapper.append(nodes)
container.append(wrapper)
}
}
Expand All @@ -122,7 +126,9 @@ export function transformLastClasses(transformClass, { wrap, withRule } = {}) {

if (wrap) {
let wrapper = wrap()
wrapper.append(container.nodes)
let nodes = container.nodes
container.removeAll()
wrapper.append(nodes)
container.append(wrapper)
}
}
Expand Down

0 comments on commit 0b6176b

Please sign in to comment.