import { postcss } from "https://deno.land/x/fed_dev@0.9.0/deps.ts";
const { Container } = postcss;
Traverses the container’s descendant nodes, calling callback for each at-rule node.
If you pass a filter, iteration will only happen over at-rules that have matching names.
Like Container#each
, this method is safe
to use if you are mutating arrays during iteration.
root.walkAtRules(rule => {
if (isOld(rule.name)) rule.remove()
})
let first = false
root.walkAtRules('charset', rule => {
if (!first) {
first = true
} else {
rule.remove()
}
})
Parameters
callback: (atRule: AtRule, index: number) => false | void