lightningcss-php / lightningcss
Lightning CSS in-process for PHP: transform, minify, bundle, and source maps without Node.js, backed by a statically linked vendored Lightning CSS
Package info
github.com/FojleRabbiRabib/lightningcss-php
Type:php-ext
Ext name:ext-lightningcss
pkg:composer/lightningcss-php/lightningcss
Requires
- php: ~8.3.0 || ~8.4.0 || ~8.5.0
Requires (Dev)
- nikic/php-parser: ^5.0
- phpstan/phpstan: ^2.1
- squizlabs/php_codesniffer: ^3.13
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-27 18:39:52 UTC
README
Lightning CSS in-process for PHP: transform, minify, bundle, and generate source maps without installing Node.js, npm, or PostCSS.
Backed by a statically linked build of the spec-grade Lightning CSS engine (Rust, MPL-2.0).
Current status
Skeleton (v0.1.0 pre-release): multi-ABI build, Rust shim crate, symbol-isolated
linking, PIE package manifest, and the base extension surface (Lightningcss\Exception,
lightningcss.max_input_bytes INI). The CSS processing surface (transform, minify, bundle,
source maps) is being implemented next; every capability will be proposed before landing.
Requirements
- PHP 8.3, 8.4, or 8.5 (development headers required for source builds)
- Rust toolchain >= 1.75 (managed via rustup)
- C compiler with C99 support (GCC or Clang)
- Linux (x86_64, aarch64)
Installation
From source
# Multi-ABI build (builds all installed PHP versions): tools/build.sh # Or single-version build via phpize: phpize8.3 ./configure --enable-lightningcss make -j"$(nproc)" # The built extension is in modules/lightningcss.so
See docs/installation.md for full prerequisites, configure
options, and troubleshooting.
PIE / Composer
composer.json declares type: php-ext for PIE (PHP Installer for Extensions) support:
pie install lightningcss-php/lightningcss
Base surface
Lightningcss\Exception: the base exception type every extension failure extends.lightningcss.max_input_bytes: INI setting bounding input stylesheet size (default16777216= 16 MiB). Configurable inphp.inior viaini_set().
Full options and contracts will be documented in docs/usage.md.
Security
See docs/security.md for the threat model, untrusted-input handling,
and vulnerability reporting.
Licence
The extension code is licensed under the Apache License, Version 2.0 (the LICENSE
file).
The vendored Lightning CSS engine is licensed under the Mozilla Public License,
Version 2.0. Statically linked release artifacts record the exact upstream pin; see
NOTICE for details.