Global

Type Definitions

builder(part, node, typeopt)

Source:
Parameters:
Name Type Attributes Description
part string

part of generated CSS connected to this node

node Node

AST node

type "start" | "end" <optional>

node’s part type

childCondition(node, index, nodes) → {boolean}

Source:
Parameters:
Name Type Description
node Node

container child

index number

child index

nodes Array.<Node>

all container children

Returns:
Type
boolean

childIterator(node, index) → {false|undefined}

Source:
Parameters:
Name Type Description
node Node

container child

index number

child index

Returns:

returning false will break iteration

Type
false | undefined

filePosition

Source:
Properties:
Name Type Description
file string

path to file

line number

source line in file

column number

source column in file

Type:
  • object

Message

Source:
Properties:
Name Type Description
type string

message type

plugin string

source PostCSS plugin name

Type:
  • object

onFulfilled(result)

Source:
Parameters:
Name Type Description
result Result

onRejected(error)

Source:
Parameters:
Name Type Description
error Error

parser(css, optsopt) → {Root}

Source:
Parameters:
Name Type Attributes Description
css string | toString

string with input CSS or any object with toString() method, like a Buffer

opts processOptions <optional>

options with only from and map keys

Returns:

PostCSS AST

Type
Root

Plugin

Source:
Properties:
Name Type Description
postcss function

PostCSS plugin function

Type:
  • object

pluginFunction(root, result)

Source:
Parameters:
Name Type Description
root Root

parsed input CSS

result Result

result to set warnings or check other plugins

position

Source:
Properties:
Name Type Description
line number

source line in file

column number

source column in file

Type:
  • object

processOptions

Source:
Properties:
Name Type Description
from string

the path of the CSS source file. You should always set from, because it is used in source map generation and syntax error messages.

to string

the path where you’ll put the output CSS file. You should always set to to generate correct source maps.

parser parser

function to generate AST by string

stringifier stringifier

class to generate string by AST

syntax syntax

object with parse and stringify

map object

source map options

Properties
Name Type Description
inline boolean

does source map should be embedded in the output CSS as a base64-encoded comment

prev string | object | false | function

source map content from a previous processing step (for example, Sass). PostCSS will try to find previous map automatically, so you could disable it by false value.

sourcesContent boolean

does PostCSS should set the origin content to map

annotation string | false

does PostCSS should set annotation comment to map

from string

override from in map’s sources

Type:
  • object

source

Source:
Properties:
Name Type Description
input Input

Input with input file

start position

The starting position of the node’s source

end position

The ending position of the node’s source

Type:
  • object

stringifier(node, builder) → {void}

Source:
Parameters:
Name Type Description
node Node

start node for stringifing. Usually Root.

builder builder

function to concatenate CSS from node’s parts or generate string and source map

Returns:
Type
void

syntax

Source:
Properties:
Name Type Description
parse parser

function to generate AST by string

stringify stringifier

function to generate string by AST

Type:
  • object

toString

Source:
Properties:
Name Type Description
toString function
Type:
  • object