Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Latest
method default.prototype.prepend
import { default } from "https://deno.land/x/postcss@8.4.16/lib/container.js";

Inserts new nodes to the start of the container.

const decl1 = new Declaration({ prop: 'color', value: 'black' })
const decl2 = new Declaration({ prop: 'background-color', value: 'white' })
rule.prepend(decl1, decl2)

root.append({ name: 'charset', params: '"UTF-8"' })  // at-rule
root.append({ selector: 'a' })                       // rule
rule.append({ prop: 'color', value: 'black' })       // declaration
rule.append({ text: 'Comment' })                     // comment

root.append('a {}')
root.first.append('color: black; z-index: 1')

Parameters

...nodes: (
| Node
| Node[]
| string
| string[]
)[]

New nodes.

Returns

this

This node for methods chain.