# Lightning CSS

> An extremely fast CSS parser, transformer, bundler, and minifier

Source: https://talira.ai/catalog/lightning-css-n8fjay3q
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library, Command-line tool
- Categories: [frontend / css / transformers](https://talira.ai/categories/frontend/css/transformers)
- Licence: MPL-2.0[^2]
- Pricing: Free and open source[^2]
- Pricing notes: Free and open source under MPL-2.0.
- Free tier: yes[^2]
- Self-hostable: yes
- Backed by: [Parcel](https://talira.ai/orgs/parcel.md)
- Creator: Devon Govett

Lightning CSS is a CSS parser, transformer, bundler and minifier written in Rust on the cssparser and selectors crates from Mozilla's Firefox, which its makers say is over 100 times faster than comparable JavaScript tools. It compiles modern CSS (nesting, custom media queries, high-gamut colours, logical properties, new selectors) to syntax your browser targets understand, adds and removes vendor prefixes, supports CSS modules with scoped names, inlines `@import` rules, and minifies by merging rules, shortening colours and reducing `calc()`. You use it as a JavaScript or Rust library, a standalone CLI or a WebAssembly build, and it is the default CSS transformer in Parcel and an option in [Vite](https://talira.ai/catalog/vite-2kbqmjmm.md) and webpack's CSS minimizer. It is MPL-2.0-licensed and made by the Parcel project.

## Links

- Website: https://lightningcss.dev/
- GitHub: https://github.com/parcel-bundler/lightningcss
- Docs: https://lightningcss.dev/docs.html

## Problems it solves

- our CSS build with PostCSS plugins is slow on a big stylesheet
- use CSS nesting and modern colour functions now and have them compiled for older browsers
- add vendor prefixes for our browser targets without maintaining a PostCSS plugin chain
- minify CSS smaller than our current minifier does
- scope class names per file with CSS modules and get the mapping in JavaScript
- inline @import rules into one stylesheet at build time
- parse and transform CSS from Rust with a parser that understands every property like a browser
- replace autoprefixer and postcss-preset-env with a single fast tool
- minify CSS in the browser or Deno with a WebAssembly build

## Features

- parses every CSS rule, property and value as a browser would, on Mozilla's cssparser and selectors crates
- syntax lowering for nesting, custom media queries, high-gamut colours, logical properties and new selectors by browser targets
- automatic vendor prefixing and removal of unneeded prefixes
- minifier that merges shorthands and rules, removes default values, reduces calc() and shortens colours
- CSS modules with locally scoped classes, ids, keyframes and variables
- bundle API that inlines @import rules
- source maps
- JavaScript (Node) and Rust libraries, a standalone CLI and a WebAssembly build
- visitor API for custom transforms
- default CSS transformer in Parcel; built-in option in Vite and css-minimizer-webpack-plugin

## Limitations

- Doesn't replace every PostCSS plugin: custom plugins may still need PostCSS alongside it[^1]

## Capabilities

- Has a command line tool: plan not known

## Trust

Overall: 0.40 out of 1.
Signals: backing 0.50, extensibility 0.20.

- backed by Parcel
- created by Devon Govett

Warnings:

- GitHub activity not fetched yet

## Alternatives

- [PostCSS](https://talira.ai/catalog/postcss-hhcseckv.md): A tool for transforming CSS with JavaScript
- [esbuild](https://talira.ai/catalog/esbuild-198nyf0k.md): An extremely fast bundler for the web
- [Sass](https://talira.ai/catalog/sass-q2bnr7qw.md): CSS with superpowers

## Sources

[^1]: https://lightningcss.dev/docs.html (checked 23 Nov 2026)
[^2]: https://github.com/parcel-bundler/lightningcss/blob/master/LICENSE (checked 23 Nov 2026)
