Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

SCSS/Less Compiler

Security covered Under active development 2,686 sites

This module automatically compiles SCSS and LESS files defined in your site's libraries into CSS. It allows configuration for where compiled files are saved and where assets are located.

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);

Drupal 8–11

Ask your assistant about SCSS/Less Compiler

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
7
Tracked since
Oct 2023
Latest release
4 months ago
Releases (12 mo)
5 ▲ from 1
Maintenance
Active

Release Timeline

Releases

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