A wrapper for scssphp to integrate scss compiling directly into Silverstripe

Installs: 4 071

Dependents: 6

Suggesters: 0

Security: 0

Stars: 4

Watchers: 1

Forks: 2

Open Issues: 0


1.6.0 2020-12-03 03:42 UTC

This package is auto-updated.

Last update: 2021-03-31 04:17:46 UTC


A wrapper for scssphp to integrate SCSS compiling directly into Silverstripe.

SCSS files are only compiled when needed, or when a ?flush is done.


  • Integrates scssphp seamlessly into Silverstripe
  • Includes flushing option (?flushstyles) to regenerate CSS stylesheets (ie. force undetected SCSS changes with @import). Note: this only applies to sites in dev mode. Alternatively use ?flush to flush everything including stylesheets.
  • Writes processed *.scss files into assets/_css/ and automatically modifies Requirements paths
  • Allows custom global variables to be passed through to SCSS compiling (yaml configuration)
  • Basic support for $ThemeDir (eg: url('#{$ThemeDir}/images/logo.png') (see Configuration)
  • Automatic compression of CSS files when in live mode (may require an initial ?flush)
  • Adds any processed editor.scss files to TinyMCE (must be included in your front-end template)
  • Source maps (either inline or file) in dev mode only, can be disabled


  • Silverstripe ^4


composer require axllent/silverstripe-scss


You need refer to your SCSS files by their full scss filenames (eg:stylesheet.scss).


use SilverStripe\CMS\Controllers\ContentController;
use SilverStripe\View\Requirements;

class PageController extends ContentController
    public function init()
        // OR search for the scss in your $themeDirs

The generated HTML will point automatically to the processed CSS file in assets/_css/ rather than the original SCSS file location, for example

<link rel="stylesheet" type="text/css"  href="/assets/_css/themes-site-css-stylesheet.css?m=123456789" />

Further documentation