2017 © Pedro Peláez
 

silverstripe-vendormodule silverstripe-scss

A wrapper for scssphp to integrate scss compiling directly into SilverStripe

image

axllent/silverstripe-scss

A wrapper for scssphp to integrate scss compiling directly into SilverStripe

  • Friday, June 1, 2018
  • by axllent
  • Repository
  • 1 Watchers
  • 0 Stars
  • 177 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 5 Versions
  • 39 % Grown

The README.md

ScssPHP compiler for Silverstripe

A wrapper for scssphp to integrate SCSS compiling directly into Silverstripe., (*1)

SCSS files are only compiled when needed, or when a ?flush is done., (*2)

Features

  • 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

Requirements

  • Silverstripe ^5

Installation

composer require axllent/silverstripe-scss

Usage

You need refer to your SCSS files by their full SCSS file names (eg:stylesheet.scss)., (*3)

Example

<?php
use SilverStripe\CMS\Controllers\ContentController;
use SilverStripe\View\Requirements;

class PageController extends ContentController
{
    public function init()
    {
        parent::init();
        Requirements::css('themes/site/css/stylesheet.scss');
        // OR search for the scss in your $themeDirs
        Requirements::themedCSS('css/stylesheet.scss');
    }
}

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

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

Further documentation

The Versions

01/06 2018

dev-master

9999999-dev https://github.com/axllent/silverstripe-scss

A wrapper for scssphp to integrate scss compiling directly into SilverStripe

  Sources   Download

MIT The MIT License (MIT)

The Requires

 

css silverstripe sass scss scssphp

01/06 2018

1.1.1

1.1.1.0 https://github.com/axllent/silverstripe-scss

A wrapper for scssphp to integrate scss compiling directly into SilverStripe

  Sources   Download

MIT

The Requires

 

css silverstripe sass scss scssphp

28/02 2018

1.1.0

1.1.0.0 https://github.com/axllent/silverstripe-scss

A wrapper for scssphp to integrate scss compiling directly into SilverStripe

  Sources   Download

MIT

The Requires

 

css silverstripe sass scss scssphp

21/02 2018

1.0.1

1.0.1.0 https://github.com/axllent/silverstripe-scss

A wrapper for scssphp to integrate scss compiling directly into SilverStripe

  Sources   Download

MIT

The Requires

 

css silverstripe sass scss scssphp

14/01 2018

1.0.0

1.0.0.0 https://github.com/axllent/silverstripe-scss

A wrapper for scssphp to integrate scss compiling directly into SilverStripe

  Sources   Download

The MIT License (MIT)

The Requires

 

css silverstripe sass scss scssphp