import { Container } from "https://deno.land/x/postcss@8.4.16/lib/postcss.js";
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