SymfonyCasts Sass Bundle

Delightful Sass support for Symfony AssetMapper with no Node.js required

Library
Composer
vv0.10.0
44stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
48/100Fair
Development Activity32
Maintenance60
Community28
Maturity52
Momentum20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
82/100Excellent
Architecture82
Code Quality82
Innovation78
Learning Curve85

The SymfonyCasts Sass Bundle adds first-class Sass/SCSS support to Symfony’s AssetMapper component without requiring Node.js. It automatically downloads the correct standalone Dart Sass binary for your platform and compiles your Sass files into CSS that AssetMapper then serves with versioned filenames.

The bundle registers a sass:build console command to compile and watch your stylesheets, and hooks into AssetMapper’s compile lifecycle so your Sass is built automatically during asset compilation and deployment. It lets Symfony developers write Sass in a modern, build-free frontend workflow.

What You Get

  • Automatic download of the correct standalone Dart Sass binary (no Node.js)
  • A sass:build console command with build and watch modes
  • Integration with Symfony AssetMapper so compiled CSS is served with versioned filenames
  • Automatic Sass compilation during asset compilation and deployment
  • Configurable Sass entrypoints and options through bundle configuration

Common Use Cases

  • Writing SCSS in a Symfony app that uses AssetMapper instead of a Node.js build toolchain
  • Watching and rebuilding Sass automatically during local development
  • Compiling Sass to versioned CSS as part of a production asset build
  • Adopting Sass in a build-free Symfony frontend without installing npm dependencies

Under The Hood

Architecture - The bundle is a thin, well-factored wrapper around Dart Sass. SassBinary (src/SassBinary.php) locates and downloads the platform-specific binary via symfony/http-client, and SassBuilder (src/SassBuilder.php) invokes it through symfony/process to compile entrypoints. A SassBuildCommand (src/Command) exposes build/watch, while AssetMapper/SassCssCompiler and a PreAssetsCompileEventListener (src/Listener) hook the compilation into AssetMapper’s lifecycle so CSS is produced before assets are digested.

Tech Stack - PHP (>=8.1) packaged as a Symfony bundle with PSR-4 autoloading under Symfonycasts\SassBundle. It depends on symfony/asset-mapper, console, filesystem, http-client, process, and finder (^5.4 through ^8.0). The actual Sass compilation is delegated to the standalone Dart Sass executable.

Code Quality - The source is small and focused, split cleanly into binary management, building, command, and AssetMapper integration. It is covered by a PHPUnit suite under tests/ and checked with PHPStan and php-cs-fixer via dedicated tools/ setups.

API Design - Setup is nearly zero-config: install the bundle, point it at a Sass entrypoint, and run sass:build (or let AssetMapper trigger it). By removing the Node.js/npm requirement entirely, it makes adopting Sass in Symfony dramatically simpler than a traditional bundler pipeline.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search