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