Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Latest
class default
extends Container<Root>
import { default } from "https://deno.land/x/postcss@8.4.16/lib/document.d.ts";

Represents a file and contains all its parsed nodes.

Experimental: some aspects of this node could change within minor or patch version releases.

const document = htmlParser(
  '<html><style>a{color:black}</style><style>b{z-index:2}</style>'
)
document.type         //=> 'document'
document.nodes.length //=> 2

Constructors

new
default(defaults?: DocumentProps)

Properties

parent: undefined
type: "document"

Methods

toResult(options?: ProcessOptions): Result

Returns a Result instance representing the document’s CSS roots.

const root1 = postcss.parse(css1, { from: 'a.css' })
const root2 = postcss.parse(css2, { from: 'b.css' })
const document = postcss.document()
document.append(root1)
document.append(root2)
const result = document.toResult({ to: 'all.css', map: true })