OSS TanbouSign in with GitHub

combine CSS parsing, transformation, minification, and browser compatibility in a Rust compiler

About these scores

OSS scale score is an unbounded metric that log-compresses and weights Stars, Watchers, Forks, and Contributors. Discovery score is the current OSS scale score minus the score at discovery. Update pace is commits in the last 30 days, growth momentum is the OSS scale score difference within the recent observation window, and OSS health is a 0–100 rating based on available recency, Community Health, and release data.

Stars
7,695
Primary language
Rust
License
MPL-2.0
Repository last updated
Sep 29, 2026
On this page

Overview

Lightning CSS is a Rust-based CSS parser, transformer, bundler, and minifier. It can use browser targets for vendor prefixing and syntax lowering and also supports CSS Modules and custom transform visitors.

Features and best fit

Based on official documentation; not hands-on tested · Content checked:

Key features

Parse CSS with typed property values

Values are parsed according to CSS grammar into typed representations, reducing duplicated interpretation work across transformations.

Sources: [1]

Combine minification, vendor prefixing, and syntax lowering from browser targets

It can add or remove prefixes, lower modern syntax, merge rules, shorten colors, reduce calculations, and apply other CSS-aware optimizations.

Sources: [1]

Support CSS Modules, bundling, and custom visitors

The project supports a subset of CSS Modules, @import bundling, and a visitor API for custom transforms.

Sources: [1]

Best fit

Fits frontend builds that want faster CSS processing with compatibility and minification in one step

It can be used through Parcel, the standalone JavaScript library, CLI workflows, or wrappers for other build tools.

Sources: [1]

Before adoption

The Node package uses native binaries and requires Node 12 or later

Version 1.33.0 declares Node >=12.0.0 and relies on platform-specific native bindings, so CI and deployment platforms should be checked for supported binaries.

Sources: [2]

It is not a drop-in implementation of the entire PostCSS plugin ecosystem

Although many transformations are built in, arbitrary PostCSS plugins do not automatically run inside Lightning CSS. Review each existing plugin dependency before replacing a pipeline.

Sources: [1]

Official sources

  1. [1]Lightning CSS v1.33.0 README(2026-10-05)
  2. [2]Lightning CSS v1.33.0 package metadata(2026-10-05)
  3. [3]Lightning CSS v1.33.0 release(2026-10-05)
  4. [4]Lightning CSS MPL-2.0 license(2026-10-05)
Supplemental curator note

Lightning CSS goes beyond minification by adding/removing vendor prefixes and lowering modern CSS according to browser targets. It is not a universal drop-in replacement for every PostCSS plugin, so existing custom transforms still need compatibility review.

Try it in 3 steps

  1. 1

    Install Lightning CSS 1.33.0 in an isolated project

    Pin the reviewed release in a temporary project without changing an existing codebase.

    demo=$(mktemp -d "${TMPDIR:-/tmp}/lightningcss.XXXXXX") && cd "$demo" && npm init -y >/dev/null && npm install --save-exact lightningcss@1.33.0
  2. 2

    Create a script that minifies CSS with the transform API

    Use the Rust-backed transform API for a minimal CSS-aware minification example.

    printf "%s\n" "import { transform } from 'lightningcss';" "const input = '.card { color: #ff0000; margin: 0px 0px 0px 0px; }';" "const result = transform({ filename: 'style.css', code: Buffer.from(input), minify: true });" "process.stdout.write(result.code);" > demo.mjs
  3. 3

    Run the transform and verify compact output

    Confirm that color, zero values, whitespace, or related CSS representations are reduced.

    node demo.mjs > output.css && grep -Eq '(red|#f00)' output.css && test "$(wc -c < output.css)" -lt 60
Check the official README

Growth

Growth trends · Last 30 days

7,695 Stars

Trend data is still being collected.

Built with

Categories and tags

Categories

GitHub data

GitHub dataView detailed GitHub data

GitHub Topics

  • build-tool
  • compiler
  • css
  • minifier
  • parser
  • rust
Stars
7,695
Forks
309
Watchers
23
Open issues
422
Owner type
Organization
Primary language
Rust
License
MPL-2.0
Repository last updated
Sep 29, 2026
Write a related article

Share a guide or use case for this OSS in Markdown. Articles are published after administrator approval.

Report incorrect information

Tell us if any listing information is incorrect or outdated.

After reading this page, do you know what to do next?