UNPKG

428 BJavaScriptView Raw
1"use strict"
2
3module.exports = function applyStyles(bundle, styles) {
4 styles.nodes = []
5
6 // Strip additional statements.
7 bundle.forEach(stmt => {
8 if (["charset", "import"].includes(stmt.type)) {
9 stmt.node.parent = undefined
10 styles.append(stmt.node)
11 } else if (stmt.type === "nodes") {
12 stmt.nodes.forEach(node => {
13 node.parent = undefined
14 styles.append(node)
15 })
16 }
17 })
18}