Drupal is a registered trademark of Dries Buytaert
cms 2.1.3 Update released for Drupal core (2.1.3)! drupal 10.5.11 Update released for Drupal core (10.5.11)! drupal 11.3.11 Update released for Drupal core (11.3.11)! drupal 11.2.13 Update released for Drupal core (11.2.13)! drupal 10.6.10 Update released for Drupal core (10.6.10)! cms 2.1.2 Update released for Drupal core (2.1.2)! drupal 11.1.10 Update released for Drupal core (11.1.10)! drupal 10.5.10 Update released for Drupal core (10.5.10)! drupal 10.4.10 Update released for Drupal core (10.4.10)! drupal 11.2.12 Update released for Drupal core (11.2.12)! drupal 11.3.10 Update released for Drupal core (11.3.10)! drupal 10.6.9 Update released for Drupal core (10.6.9)! drupal 10.6.8 Update released for Drupal core (10.6.8)! drupal 11.3.9 Update released for Drupal core (11.3.9)! drupal 11.3.8 Update released for Drupal core (11.3.8)! drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)!

scss_compiler

2,698 sites Security covered
View on drupal.org

Module automatically compiles SCSS/LESS files defined in libraries.yml into CSS.

SCSS compiler: scssphp
LESS compiler: lessphp

Starting with the 2.x branch, the module uses scssphp 2.x by default.

If you need the LESS compiler: composer require wikimedia/less.php
If you need the scssphp 1.x version: composer require scssphp/scssphp:^1.0

Installation

If you manage your site with Composer, install this module like any other Composer package. Dependencies will be resolved automatically.

Configuration

All module settings are available on the Performance page.

The “Check file modified time” option tracks the last modified time of files, so the module will not recompile files until they change.

Usage

Flush the cache after installing the module to create the compile list cache.

# my_module.libraries.yml
main:
  version: VERSION
  css:
    theme:
      scss/styles.scss: {}
      less/styles.less: {}

By default, compiled files are saved to public://scss_compiler
You can also define css_path — the path where the compiled file should be saved. The path is relative to the module/theme where libraries.yml is located, for example:

# my_module.libraries.yml
main:
  version: VERSION
  css:
    theme:
      scss/styles.scss: { css_path: '/css/' }

The file will be saved to my_module/css/styles.css

The assets_path option allows you to define where static resources are located. By default, this is the module/theme folder. The value should be the full path to the assets folder and supports tokens for a theme/module.

# my_module.libraries.yml
main:
  version: VERSION
  css:
    theme:
      scss/styles.scss: { assets_path: '@my_module/assets/' }

url(image.jpg) in CSS will be compiled to:
url(/modules/custom/my_module/assets/image.jpg);

Activity

Total releases
6
First release
Jul 2025
Latest release
2 weeks ago
Release cadence
64 days
Stability
17% stable

Release Timeline

Releases

Version Type Release date
2.0.0-alpha4 Pre-release May 17, 2026
2.0.0-alpha3 Pre-release May 11, 2026
2.0.0-alpha2 Pre-release May 6, 2026
2.0.0-alpha1 Pre-release May 5, 2026
2.0.x-dev Dev Apr 27, 2026
8.x-1.3 Stable Jul 1, 2025