Repolode
parcel-bundler

parcel-bundler/lightningcss

An extremely fast CSS parser, transformer, bundler and minifier written in Rust, usable with Parcel, as a library, CLI or plugin.

Stars
7,728
Forks
321
Open issues
442
Last commit
3 days ago

What is it?

Lightning CSS parses, transforms and minifies CSS. It can be used through Parcel, as a standalone JavaScript or Rust library, from a command-line tool, or wrapped as a plugin in other build systems.

It parses property values according to the CSS grammar, so each property has a specific value type rather than a loose token list. Based on browser targets, it adds or removes vendor prefixes, lowers modern syntax such as CSS nesting, color-mix() and lab()/oklch() colors into more compatible output, and applies many size optimizations while keeping output behavior identical to the input.

It also supports a subset of CSS modules, including locally scoped class names, keyframes and CSS variables, plus composes and :local()/:global() selectors. Browserslist configuration can be discovered opt-in.

Key features

  • 01Parses and minifies large CSS files in milliseconds.
  • 02Adds and removes vendor prefixes based on browser targets.
  • 03Lowers modern syntax such as CSS nesting and color functions for older browsers.
  • 04Merges, shortens and normalizes CSS values without changing behavior.
  • 05Supports CSS modules with scoped class names and composes.

Use cases

  • Minifying production CSS in a Parcel or other bundler pipeline.
  • Automatically prefixing and lowering modern CSS for a defined browser support list.
  • Scoping class names in a component-based app using CSS modules.
  • Building a custom CSS transform using the visitor API.

In collections

Topics

#css#minifier#bundler#rust#autoprefixer#css-modules#build-tool#compiler#parser

FAQ

What is lightningcss?
An extremely fast CSS parser, transformer, bundler and minifier written in Rust, usable with Parcel, as a library, CLI or plugin. Lightning CSS parses, transforms and minifies CSS. It can be used through Parcel, as a standalone JavaScript or Rust library, from a command-line tool, or wrapped as a plugin in other build systems.
Is lightningcss free to use? What license does it have?
lightningcss is open source under the MPL-2.0 license. Check the license terms before using it in commercial products.
Is lightningcss still maintained?
Actively maintained. The last commit to lightningcss was on Nov 4, 2026.
What can I use lightningcss for?
Minifying production CSS in a Parcel or other bundler pipeline. Automatically prefixing and lowering modern CSS for a defined browser support list. Scoping class names in a component-based app using CSS modules. Building a custom CSS transform using the visitor API.
Where can I get lightningcss?
The source code and installation instructions are on GitHub: https://github.com/parcel-bundler/lightningcss

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects