POSTCSS(1)

πŸ“¦
version 10.1.0+~cs16.11.1 Β· 2 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– POSTCSS πŸ’–

okay bestie, gather round, because postcss is literally the command-line client for node??-postcss and it's giving main character energy from the very first flag. 🌈✨


πŸ¦‹ DESCRIPTION πŸ¦‹

the usage, bestie</p>

fr fr, here's how you call on it:

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

like. five whole ways to show up. pick your vibe. πŸ‘‘


✨ Basic options ✨

  • -o, --output β€” the output file. that's it, that's the whole job. [string] πŸŽ€
  • -d, --dir β€” the output directory, sis. plural energy. [string]
  • -r, --replace β€” replace (overwrite) the input file. yes, overwrite, like it said. [boolean] 😭
  • -m, --map β€” make an external sourcemap. fancy map, outside the file. πŸ—ΊοΈ
  • --no-map β€” turn off the default inline sourcemaps. not me disabling the default… πŸ™ˆ
  • -w, --watch β€” watch the files for changes and recompile whenever they need it. it's giving devoted. [boolean] πŸ‘€
  • --verbose β€” be verbose. spill the tea, bestie. [boolean] πŸ’¬
  • --env β€” a shortcut for setting NODE_ENV. [string] 🌱

🧚 Options for use without a config file 🧚

  • -u, --use β€” a list of postcss plugins to use. [array] πŸ”₯
  • --parser β€” custom postcss parser. [string]
  • --stringifier β€” custom postcss stringifier. [string]
  • --syntax β€” custom postcss syntax. [string]

πŸŽ€ Options for use with --dir πŸŽ€

  • --ext β€” override the output file extension; for use with --dir. [string]
  • --base β€” mirror the directory structure relative to this path in the output directory, for use with --dir. [string]

πŸ‘‘ Advanced options πŸ‘‘

  • --include-dotfiles β€” enable glob to match files/dirs that begin with ".". yes, the sneaky ones. [boolean]
  • --poll β€” use polling for file watching. you can optionally pass a polling interval; default 100 ms. ⏱️
  • --config β€” set a custom directory to look for a config file. [string] πŸ—‚οΈ

🌸 OPTIONS 🌸

lowkey these two are the homies you'll use every single time:

  • --version β€” show version number. [boolean] πŸ“Œ
  • -h, --help β€” show help. your emergency bestie. [boolean] πŸ†˜

πŸ”₯ EXAMPLES πŸ”₯

basic usage, periodt

postcss input.css -o output.css

glob pattern & output πŸ¦‹

postcss src/**/*.css --base src --dir build

piping input & output πŸ“

cat input.css | postcss -u autoprefixer > output.css

πŸ’œ the important little notes πŸ’œ

so if no input files are passed, it reads from stdin. and if neither -o, --dir, or --replace is passed, it writes to stdout. no cap. 🫢

if there are multiple input files, you must pass the --dir or the --replace option. like, non-negotiable bestie. 🀨

input files may contain globs (e.g. src/**/*.css). and if you pass an input directory, it will process all files in the directory and any subdirectories, respecting the glob pattern. it's thorough like that. πŸ’…

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


okay that's the whole manual, you're basically a postcss girlie now. go compile something iconic. πŸ§šβ€β™€οΈ

this has been postcss 16.2.0, from November 2024 πŸ’– mwah, bye bestie, see u at the next build πŸŽ€

πŸ“¦ where this page comes from