Skip to main content
The Deno 2 Release Candidate is here
Learn more
Latest
method default.prototype.prev
import { default } from "https://deno.land/x/postcss@8.4.16/lib/node.d.ts";

Returns the previous child of the node’s parent. Returns undefined if the current node is the first child.

const annotation = decl.prev()
if (annotation.type === 'comment') {
  readAnnotation(annotation.text)
}

Returns

ChildNode | undefined

Previous node.