Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/bundler/deps.ts>postcss.Container#prepend

A Bundler with the web in mind.
Go to Latest
method postcss.Container.prototype.prepend
Re-export
import { postcss } from "https://deno.land/x/bundler@0.6.5/deps.ts";
const { Container } = postcss;

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.