Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use SASS/ SCSS in Yii2?

Tags:

sass

yii2

I want to use sass/scss in a new project, but it somehow doesn't work. I am using the yii2-asset-converter and when I try to convert the scss-file, the following error is thrown:

Class @app/extensions/assetparser/vendors/phamlp/sass/SassParser does not exist

I am checking the path ../phamlp/ and notice, that the Folder sass resp. SassParser.php doesn't exist. The SassParser.php is located in the extension vendor/richthegeek/phpsass, which is required by yii2-asset-converter.

I have tried out some paths like: @ vendor/richthegeek/phpsass or

__DIR__/../../vendor/richthegeek/phpsass

But it doesn't worked .After a lot of unsuccessful attempts I hope some of you know how to solve the problem.

PS:I use the advanced app template

like image 452
atkaz Avatar asked Sep 05 '14 23:09

atkaz


1 Answers

Don't use PhalmP or phpsass. These are outdated. You'll never get satisfactory results with them, especially when using modern Sass libraries.

Use original Sass as a standalone.

Simply install Ruby (you might already have it) and Sass and use the sass command line tool to compile.

Also, using Compass might make your life easier. Compass helps organizing your Sass code and also provides a Sass library with a lot of useful helpers.

like image 138
Andrey Mikhaylov - lolmaus Avatar answered Sep 29 '22 09:09

Andrey Mikhaylov - lolmaus