Lightning CSS is a high-performance CSS toolchain implemented in Rust. It provides a comprehensive suite of tools for stylesheet processing, including a bundler, minifier, module compiler, syntax lowerer, and vendor prefixer.
The engine utilizes a browser-grade grammar for parsing and converts stylesheets into typed property values. It distinguishes itself through a visitor-based transformation API that allows for custom modifications of the parsed abstract syntax tree and an error-tolerant parsing mechanism that recovers from malformed syntax to prevent build failures.
The toolset covers broad capability areas including cross-browser compatibility via automatic vendor prefixing and syntax lowering, stylesheet minification through property optimization, and CSS module compilation for local selector scoping. It also supports merging multiple stylesheets into a single output by resolving imports.
The toolchain generates source maps to correlate transformed output with the original source code.