import { postcss } from "https://deno.land/x/bundler@0.6.5/deps.ts";
const { Container } = postcss;
Traverses the container’s descendant nodes, calling callback for each declaration node.
If you pass a filter, iteration will only happen over declarations with matching properties.
root.walkDecls(decl => {
checkPropertySupport(decl.prop)
})
root.walkDecls('border-radius', decl => {
decl.remove()
})
root.walkDecls(/^background/, decl => {
decl.value = takeFirstColorFromGradient(decl.value)
})
Like Container#each
, this method is safe
to use if you are mutating arrays during iteration.
Parameters
callback: (decl: Declaration, index: number) => false | void
Iterator receives each node and index.
Parameters
callback: (decl: Declaration, index: number) => false | void