Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). Varbase Media Header 9.2.1 Minor update available for module varbase_media_header (9.2.1). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

SCSS/Less Compiler

2,712 sites Security covered
View on drupal.org

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

Activity

Total releases
6
First release
Jul 2025
Latest release
2 months ago
Releases (12 mo)
5 ▲ from 1
Maintenance
Active

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