Drupal is a registered trademark of Dries Buytaert
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)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). eca 3.1.1 Minor update available for module eca (3.1.1). layout_paragraphs 2.1.3 Minor update available for module layout_paragraphs (2.1.3). ai 1.3.3 Minor update available for module ai (1.3.3). ai 1.2.14 Minor update available for module ai (1.2.14). node_revision_delete 2.0.3 Minor update available for module node_revision_delete (2.0.3). moderated_content_bulk_publish 2.0.52 Minor update available for module moderated_content_bulk_publish (2.0.52). klaro 3.0.10 Minor update available for module klaro (3.0.10). klaro 3.0.9 Minor update available for module klaro (3.0.9). layout_paragraphs 2.1.2 Minor update available for module layout_paragraphs (2.1.2). geofield_map 11.1.8 Minor update available for module geofield_map (11.1.8).

scss_compiler

2,805 sites Security covered
View on drupal.org

Module automatically compiles scss/less files defined in a libraries.yml into css
SCSS compiler: ScssPhp
LESS compiler: LessPhp

LESS library not included by default because of php 7.2.9 dependency, you need to install it manually via composer "composer require wikimedia/less.php"

Manual installation

SCSS:
1. Download a last release of ScssPhp Compiler
2. Rename it to scssphp and place it to the libraries directory (DRUPAL_ROOT/libraries/)
3. Install the module and all scss files defined in a libraries.yml will be compiled into css

LESS:
1. Download a last release of LessPhp Compiler
2. Rename it to less.php and place it to the libraries directory (DRUPAL_ROOT/libraries/)
3. Install the module and all less files defined in a libraries.yml will be compiled into css

Composer installation

If you manage your site with composer, just install it like other composer
packages, dependencies will be resolved automatically.

Configuration

All module settings are on the performance page.

Option "Check file modified time" tracks a last modified time of files and the
module won't recompile files before they change.

Usage

Flush cache after the module installation to create a compile list cache.

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

By default, compiled files save to public://scss_compiler
Also you can define css_path — path where to save the compiled file,
the path is relative to a module/theme where a libraries.yml is located, for example:

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

File will be saved to my_module/css/styles.css

Assets path option allows to define where static resources are located, by default
it's a module/theme folder. Full path to an assets folder, 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
1
First release
Jul 2025
Latest release
9 months ago
Release cadence
Stability
100% stable

Releases

Version Type Release date
8.x-1.3 Stable Jul 1, 2025