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

Represents a CSS file and contains all its parsed nodes.

const root = postcss.parse('a{color:black} b{z-index:2}')
root.type         //=> 'root'
root.nodes.length //=> 2

Constructors

new
default(defaults?: RootProps)

Properties

parent: Document | undefined
raws: RootRaws
type: "root"

Methods

assign(overrides: object | RootProps): this
toResult(options?: ProcessOptions): Result

Returns a Result instance representing the root’s CSS.

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