Download the PHP package dnafactory/module-scss without Composer
On this page you can find all versions of the php package dnafactory/module-scss. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dnafactory/module-scss
More information about dnafactory/module-scss
Files in dnafactory/module-scss
Package module-scss
Short Description Provides an scss preprocessor to Magento 2
License BSD-3-Clause
Informations about the package module-scss
M2 Scss Preprocessor
Provides an Scss preprocessor (scssphp/scssphp) to Magento 2 as an Alternative Source Content Processor.
Supports Magento 2 Theme inheritance and Assets fallback system.
Frontend compilation is currently not tested and not fully implemented yet.
How to use
Put your base scss file in your preferred location as Magento 2 standards. Ex:
- app/design/frontend/MyCompany/theme/web/css/--->mystyle.scss
- app/code/MyCompany/MyModule/view/frontend/web/css/--->mystyle.scss
- app/design/frontend/MyCompany/theme/TheirCompany_TheirModule/web/css/--->mystyle.scss
Then add your source files references as you do with .less ones. Oh, and you can use Magento custom directives (like @magento_import) too. Ex:
The @vars_import directive
As Magento 2 comes only with .less preprocessor, you may need to merge your new shiny scss project into the old fashioned .less theme. When it comes to needs, you can simply use the @vars_import directive on top of your main scss file to load and translate .less vars. Ex:
All less variables will be translated into scss readable ones, so you can then reference them in your scss subsequent assets.
Ex: @primary__color will be accessible as $primary__color
When you are coding in a module context you may need to import Magento 2 .less lib vars. Therefore, to avoid context issues, it may come in handy to use the @vars_import directive with the addition of the (lib) identifier. Ex:
Happy Coding
All versions of module-scss with dependencies
scssphp/scssphp Version ^1.4.0
wikimedia/less.php Version ^3.0.0|1.8.2.1 as 1.8.2