Replace the current PostCSS pipeline with Lightning CSS. Lightning CSS is a fast CSS parser, transformer, and minifier written in Rust, with built-in support for nesting, custom media queries, and modern CSS features without needing separate plugins.

Motivation

  • Significantly faster CSS processing (Rust-based)
  • Native support for CSS nesting, no plugin needed
  • Built-in vendor prefixing and browser target support
  • Vite has built-in Lightning CSS integration
  • Reduce dependency count by removing PostCSS plugins

Tasks

  • Enable css.lightningcss in vite.config.js
  • Replace postcss-nested-props usage with standard CSS nesting
  • Replace postcss-simple-vars with CSS custom properties
  • Replace postcss-easy-import with native CSS imports
  • Remove postcss-preset-env (Lightning CSS handles transforms)
  • Remove postcss.config.cjs
  • Update svelte-preprocess config if needed
  • Test all component styles for regressions

Risks

  • postcss-nested-props shorthand has no direct equivalent in Lightning CSS — need to expand manually
  • postcss-simple-vars ($var syntax) needs migrating to var(--var)
  • Some edge cases in nesting behavior may differ between PostCSS and Lightning CSS

Build performance

Faster CSS processing

A static site template built with SvelteKit.

Sveleton, 2025