postcss

A CSS transformation engine that parses styles into an AST, letting JS plugins lint, prefix, and rewrite CSS — the foundation beneath Autoprefixer, Tailwind, and 200+ other tools.

Library
npm
v8.5.28
28,977 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
92 /100 Excellent
Development Activity 96
Maintenance 96
Community 76
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
88 /100 Excellent
Architecture 92
Code Quality 93
Innovation 88
Learning Curve 80

PostCSS parses CSS into an abstract syntax tree and exposes that tree to a pipeline of JavaScript plugins, each free to inspect or rewrite rules, declarations, and at-rules before the result is stringified back to CSS. It doesn’t impose its own syntax the way a preprocessor like Sass does — it works with real CSS (and CSS-like syntaxes via pluggable parsers) and lets the plugin ecosystem, not the core, decide what transformations happen.

That plugin model has made PostCSS the shared foundation underneath more than 200 published plugins, including Autoprefixer for vendor prefixing and Tailwind CSS’s own processing pipeline. The core ships as a small, dependency-light library (three runtime dependencies) with hand-maintained TypeScript type definitions, 100%-enforced test coverage, and a decade-old plugin contract that has stayed stable enough for that whole ecosystem to build on top of it without breaking changes.

What You Get

  • A stable, class-based CSS AST (Root/Rule/AtRule/Declaration/Comment) with walk* traversal helpers for writing your own transformations.
  • A processing pipeline (postcss(plugins).process(css)) that supports both synchronous and asynchronous plugins.
  • Built-in source map generation and consumption for tracing transformed CSS back to its original source.
  • Typed CSS syntax errors with optional terminal-highlighted output pointing at the exact source location of a parse failure.

Common Use Cases

  • Running Autoprefixer, Tailwind CSS, or cssnano — all of which are PostCSS plugins under the hood.
  • Writing a custom lint rule or codemod that needs to inspect or rewrite CSS programmatically.
  • Parsing non-standard CSS-like syntaxes (Sass, Less, CSS-in-JS template literals) via one of PostCSS’s pluggable syntax parsers.

Under The Hood

Architecture PostCSS splits CSS processing into three explicit stages: a tokenizer (lib/tokenize.js) that turns a raw CSS string into a flat token stream, a parser (lib/parser.js) that assembles those tokens into a class-based AST rooted at a Root node with Rule/AtRule/Declaration/Comment children, and a stringifier that walks the same AST back into CSS text. Plugins operate entirely on the AST between the parse and stringify stages, using walkDecls/walkRules/walkAtRules traversal helpers inherited from a shared Container base class. This split — the project’s own architecture documentation explicitly justifies it on performance and readability grounds — is what lets a decade of downstream plugins (Autoprefixer, cssnano, postcss-nested, and 200+ others) share one stable core without needing to write their own parser.

Tech Stack The runtime is plain, unbundled JavaScript published directly to npm, with dual CommonJS/ESM entry points declared via package.json’s exports map. TypeScript is used only for the test suite (via ts-node) and for hand-authored .d.ts type declarations shipped alongside the JS — there is no build-time compilation step for the library itself. Runtime dependencies are deliberately minimal: nanoid for identifier generation, picocolors for terminal-colored error output, and source-map-js for source map handling. Node’s engines field (^10 || ^12 || >=14) reflects an unusually wide backward-compatibility commitment for an actively maintained library.

Code Quality 26 TypeScript test files run through the lightweight uvu test runner, with a c8 coverage configuration that enforces 100% line coverage as a hard requirement, not an aspiration. A dedicated fuzzing directory hardens the parser against malformed input, and separate integration.js/old-node.js scripts test cross-Node-version behavior. ESLint runs as its own required test step, and the shipped .d.ts type definitions are validated with check-dts rather than trusted as-authored. This is a mature, rigorously tested codebase commensurate with sitting underneath hundreds of other packages’ CI pipelines.

API Design The public surface is a single factory function, postcss(…plugins), returning a Processor whose .process(css) result supports both synchronous .css access and .then() for pipelines containing async plugins. The AST’s walk* traversal methods mirror patterns familiar from other JS-ecosystem AST tools (e.g. Babel’s visitor style), which lowers the learning curve for anyone who has written a codemod before. The main friction newcomers hit is historical: a deprecated postcss.plugin() helper (kept for backward compatibility, emits a runtime warning) and the dual CJS/ESM export surface both add a small amount of legacy surface area a brand-new API wouldn’t have.

Used by 277 apps in this directory

TypeScript
96%
Apache 2.0

Pezzo

AI Development · Monitoring

3,275

Open-source LLMOps platform for prompt management, AI observability, intelligent caching, and real-time cost tracking across LLM providers.

View details
61
Repo Health
75
Technical
66
Dependency
Built with
TypeScript 96%
Updated 1 months ago
TypeScript
51%
Other

Phase Console

Devops · Security

924

End-to-end encrypted secrets management for engineering teams — from local dev to Kubernetes production.

View details
84
Repo Health
73
Technical
63
Dependency
Built with
TypeScript 51%
Python 48%
Updated 1 weeks ago
Python
49%
Other

Arize Phoenix

Analytics · Devops · Monitoring

11,641

Open-source AI observability platform for tracing, evaluating, and debugging LLM applications with built-in intelligence and MCP support.

View details
90
Repo Health
88
Technical
67
Dependency
Built with
Python 49%
TypeScript 42%
Updated 1 weeks ago
Rust
66%
GPL 3.0

Pipedash

Developer Tools · Devops · Monitoring

1,085

One dashboard to monitor, trigger, and cancel CI/CD pipelines across GitHub, GitLab, Jenkins, Tekton, Buildkite, ArgoCD, and Bitbucket — desktop, Docker, or iOS.

View details
50
Repo Health
64
Technical
73
Dependency
Built with
Rust 66%
TypeScript 33%
Updated 1 months ago
TypeScript
69%
AGPL 3.0

Plane

Collaboration · Productivity · Project Management

59,964

Open-source project management platform to replace Jira, Linear, and ClickUp — with built-in cycles, real-time collaborative docs, and full self-hosting.

View details
90
Repo Health
82
Technical
77
Dependency
Built with
TypeScript 69%
Python 27%
Updated 1 weeks ago
TypeScript
89%
MIT

Plasmic

CMS · Design Tools · Low Code Platforms

7,048

The open-source visual builder that lets teams design React apps and websites with drag-and-drop while integrating seamlessly with your codebase.

View details
81
Repo Health
78
Technical
64
Dependency
Built with
TypeScript 89%
Updated 1 weeks ago
Python
65%
Apache 2.0

Polar

Developer Tools · Ecommerce · Invoicing Finance

10,293

Open source payments infrastructure that turns software into a business — subscriptions, usage-based billing, digital products, and merchant-of-record compliance in one platform.

View details
90
Repo Health
82
Technical
66
Dependency
Built with
Python 65%
TypeScript 28%
Updated 1 weeks ago
TypeScript
51%
ZLIB

Portainer

Devops

38,590

A lightweight, open-source web UI that puts Docker, Kubernetes, and Podman management within reach of any team—no CLI expertise required.

View details
92
Repo Health
79
Technical
65
Dependency
Built with
TypeScript 51%
Go 38%
Updated 2 weeks ago
Python
55%
Other

PostHog

Ab Testing Experimentation · Analytics · Developer Tools

39,975

The all-in-one open source product platform combining analytics, session replay, feature flags, error tracking, AI observability, and a built-in data warehouse in a single self-hostable stack.

View details
92
Repo Health
80
Technical
65
Dependency
Built with
Python 55%
TypeScript 36%
Updated 1 weeks ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers