Scroll to navigation

POSTCSS(1) User Commands POSTCSS(1)

NAME

postcss - Command-line client for node??-postcss

DESCRIPTION

Usage:

postcss [input.css] [OPTIONS] [-o|--output output.css] [--watch|-w] postcss <input.css>... [OPTIONS] --dir <output-directory> [--watch|-w] postcss <input-directory> [OPTIONS] --dir <output-directory> [--watch|-w] postcss <input-glob-pattern> [OPTIONS] --dir <output-directory> [--watch|-w] postcss <input.css>... [OPTIONS] --replace

Basic options:

Output file [string]
Output directory [string]
Replace (overwrite) the input file [boolean]
Create an external sourcemap
Disable the default inline sourcemaps
Watch files for changes and recompile as needed [boolean]
Be verbose [boolean]
A shortcut for setting NODE_ENV [string]

Options for use without a config file:

List of postcss plugins to use [array]
Custom postcss parser [string]
Custom postcss stringifier [string]
Custom postcss syntax [string]

Options for use with --dir:

Override the output file extension; for use with --dir [string]
Mirror the directory structure relative to this path in the output
[string]

Advanced options:

Enable glob to match files/dirs that begin with "." [boolean]
Use polling for file watching. Can optionally pass pol ling interval; default 100 ms
Set a custom directory to look for a config file [string]

OPTIONS

Show version number [boolean]
Show help [boolean]

EXAMPLES

Basic usage
Glob Pattern & output
ild cat input.css | postcss -u autoprefixer Piping input & output > output.css

If no input files are passed, it reads from stdin. If neither -o, --dir, or --re place is passed, it writes to stdout.

If there are multiple input files, the --dir or --replace option must be passed.

Input files may contain globs (e.g. src/**/*.css). If you pass an input director y, it will process all files in the directory and any subdirectories, respecting

the glob pattern.

For more details, please see https://github.com/postcss/postcss-cli

December 2022 postcss 16.2.0