dev-master
9999999-devCompiler for SCSS
MIT
The Requires
by Chase Giunta
cms scss craftcms craft-plugin craft
1.0.0
1.0.0.0Compiler for SCSS
MIT
The Requires
by Chase Giunta
cms scss craftcms craft-plugin craft
Compiler for SCSS
Compile SCSS to CSS in your templates, (*1)
, (*2)
This plugin requires Craft CMS 4.0.0 or later., (*3)
To install the plugin, follow these instructions., (*4)
Open your terminal and go to your Craft project:, (*5)
cd /path/to/project
Then tell Composer to load the plugin:, (*6)
composer require chasegiunta/scss
In the Control Panel, go to Settings → Plugins and click the “Install” button for SCSS., (*7)
Craft conveniently offers {% css %}
tags to include template-specific styles in the head
of your page. This plugin takes that functionality a bit further by enabling support for compiling SCSS to CSS with {% scss %}
using the scssphp library (https://github.com/scssphp/scssphp)., (*8)
By default, while working with devMode enabled, the styles generated will be output into a readable expanded
format. If Craft is not running in devMode, the styles will be uglified into a compressed
format., (*9)
You can configure these default output formats by copying the scss.php
file from the plugin directory in your config
folder., (*10)
{% scss %} ... insert scss here ... {% endscss %}
Given the following SCSS:, (*11)
{% scss %} /*! Comment */ .navigation { ul { line-height: 20px; color: blue; a { color: red; } } } .footer { .copyright { color: silver; } } {% endscss %}
Specifying an output format will take precedence over any default settings in config/scss.php
., (*12)
{% scss expanded %}
, (*13)
/*! Comment */ .navigation ul { line-height: 20px; color: blue; } .navigation ul a { color: red; } .footer .copyright { color: silver; }
{% scss compressed %}
, (*14)
/* Comment*/.navigation ul{line-height:20px;color:blue;}.navigation ul a{color:red;}.footer .copyright{color:silver;}
When you import a file using the @import
directive, the current path of your Craft install is used as the search path., (*15)
Brought to you by Chase Giunta, (*16)
Compiler for SCSS
MIT
cms scss craftcms craft-plugin craft
Compiler for SCSS
MIT
cms scss craftcms craft-plugin craft