2017 © Pedro Peláez
 

yii2-extension yii2-asset-converter

Less, Sass, and Scss converter for Yii2. No system requires. yii2-composer support, Less autoupdate, customizing of output directory

image

max-dreamsoft/yii2-asset-converter

Less, Sass, and Scss converter for Yii2. No system requires. yii2-composer support, Less autoupdate, customizing of output directory

  • Friday, February 2, 2018
  • by max-dreamsoft
  • Repository
  • 1 Watchers
  • 0 Stars
  • 20 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 38 Forks
  • 0 Open issues
  • 25 Versions
  • 33 % Grown

The README.md

Only for YII2 with the new Asset Manager, convert Less and Sass files to CSS whithout external tools and executable. The sass and less files are converted with PHP libraries It replace the AssetConverter who use external tools. The Less and Sass file are converted with time source files dependency., (*1)

Requirements

YII 2.0, (*2)

Usage

1) Install with Composer, (*3)


"require": { "dreamsoft/yii2-asset-converter": "1.*", }, php composer.phar update

2) Modify assetManager in your configuration file {app}/protected/config/main.php, (*4)

    'assetManager' => [
        'bundles' => require(__DIR__ . '/assets.php'),
        'converter'=> [
            'class'=>'dreamsoft\assetConverter\Converter',
        ]
    ],

3) Create .gitignore in 4) Enjoy!, (*5)

  • Files with extension .sass are converted to a .css file
  • Files with extension .less are converted to a .css file
  • Files with extension .scss are converted to a .css file

Example of assets config file /protected/config/assets.php


return [ 'app' => [ 'basePath' => '@webroot', 'baseUrl' => '@web', 'css' => [ 'css/bootstrap.min.css', 'css/bootstrap-responsive.min.css', 'css/site.css', 'css/less_style.less', 'css/sass_style.sass', ], 'js' => [ ], 'depends' => [ 'yii', ], ], ];

Where is compiled files?

By default it present at @webroot/compiled But you can change it by destinationDir property from config, (*6)

Full configuration


'components' => [ 'assetManager' => [ 'converter'=> [ 'class'=> 'dreamsoft\assetConverter\Converter', 'force'=> false, // true : If you want convert your sass each time without time dependency 'destinationDir' => 'compiled', // at which folder of @webroot put compiled files 'destinationDirPerms' => 0755, // permissions to assign to destinationDir 'recursiveRecompileCheck' => false, // check timestamps of all source siblings and children 'parsers' => [ 'sass' => [ // file extension to parse 'class' => 'dreamsoft\assetConverter\Sass', 'output' => 'css', // parsed output file type 'options' => [ 'cachePath' => '@app/runtime/cache/sass-parser' // optional options ], ], 'scss' => [ // file extension to parse 'class' => 'dreamsoft\assetConverter\Scss', 'output' => 'css', // parsed output file type 'options' => [] // optional options ], 'less' => [ // file extension to parse 'class' => 'dreamsoft\assetConverter\Less', 'output' => 'css', // parsed output file type 'options' => [ 'auto' => true, // optional options ] ] ] ] ], ],

Also, for SCSS files you can use alternate configuration:, (*7)

'components' => [
    'assetManager' => [
            'converter'=> [
                // ...
                'parsers' => [
                    // ...
                    'scss' => [ // file extension to parse
                        'class' => 'dreamsoft\assetConverter\Scss',
                        'output' => 'css', // parsed output file type
                        'options' => [ // optional options
                            'enableCompass' => true, // default is true
                            'importPaths' => [], // import paths, you may use path alias here, 
                                // e.g., `['@path/to/dir', '@path/to/dir1', ...]`
                            'lineComments' => false, // if true — compiler will place line numbers in your compiled output
                            'generateMap' => false, // if true — compiler will generate map **
                            'outputStyle' => 'nested', // May be `compressed`, `crunched`, `expanded` or `nested`,
                                // see more at http://sass-lang.com/documentation/file.SASS_REFERENCE.html#output_style
                        ],
                    ],
                ],
            ],
        ],
    // ...

** possible values for generateMap are: * \Leafo\ScssPhp\Compiler::SOURCE_MAP_FILE * \Leafo\ScssPhp\Compiler::SOURCE_MAP_INLINE * all (bin) positive values are SOURCE_MAP_FILE * all (bin) negative values are SOURCE_MAP_NONE, (*8)

The Versions

02/02 2018

dev-master

9999999-dev

Less, Sass, and Scss converter for Yii2. No system requires. yii2-composer support, Less autoupdate, customizing of output directory

  Sources   Download

BSD-3-Clause

The Requires

 

yii2 yii asset converter less sass scss compass

02/02 2018

2.1.0

2.1.0.0

Less, Sass, and Scss converter for Yii2. No system requires. yii2-composer support, Less autoupdate, customizing of output directory

  Sources   Download

BSD-3-Clause

The Requires

 

yii2 yii asset converter less sass scss compass

01/02 2018

2.0.4

2.0.4.0

Less, Sass, and Scss converter for Yii2. No system requires. yii2-composer support, Less autoupdate, customizing of output directory

  Sources   Download

BSD-3-Clause

The Requires

 

yii2 yii asset converter less sass scss compass

29/12 2016

2.0.0

2.0.0.0

TEST

  Sources   Download

30/12 2015

v1.3.0

1.3.0.0

Less, Sass, Scss and Phamlp converter for Yii2. No system requires. yii2-composer support, Less autoupdate, customizing of output directory

  Sources   Download

BSD-3-Clause

The Requires

 

by Alex Sharov

yii2 yii asset converter less sass scss compass phamlp

15/11 2015

v1.2.8

1.2.8.0

Less, Sass, Scss and Phamlp converter for Yii2. No system requires. yii2-composer support, Less autoupdate, customizing of output directory

  Sources   Download

BSD-3-Clause

The Requires

 

by Alex Sharov

yii2 yii asset converter less sass scss compass phamlp

10/06 2015

v1.2.7

1.2.7.0

Less, Sass, Scss and Phamlp converter for Yii2. No system requires. yii2-composer support, Less autoupdate, customizing of output directory

  Sources   Download

BSD-3-Clause

The Requires

 

by Alex Sharov

yii2 yii asset converter less sass scss compass phamlp

04/04 2015

v1.2.6

1.2.6.0

Less, Sass and Phamlp converter for Yii2. No system requires. yii2-composer support, Less autoupdate, customizing of output directory

  Sources   Download

BSD-3-Clause

The Requires

 

by Alex Sharov

yii2 yii asset converter less sass phamlp

03/02 2015

v1.2.5

1.2.5.0

Less, Sass and Phamlp converter for Yii2. No system requires. yii2-composer support, Less autoupdate, customizing of output directory

  Sources   Download

BSD-3-Clause

The Requires

 

by Alex Sharov

yii2 yii asset converter less sass phamlp

10/01 2015

v1.2.4

1.2.4.0

Less, Sass and Phamlp converter for Yii2. No system requires. yii2-composer support, Less autoupdate, customizing of output directory

  Sources   Download

BSD-3-Clause

The Requires

 

by Alex Sharov

yii2 yii asset converter less sass phamlp

11/12 2014

v1.2.3

1.2.3.0

Less, Sass and Phamlp converter for Yii2. No system requires. yii2-composer support, Less autoupdate, customizing of output directory

  Sources   Download

BSD-3-Clause

The Requires

 

by Alex Sharov

yii2 yii asset converter less sass phamlp

26/11 2014

v1.2.2

1.2.2.0

Less, Sass and Phamlp converter for Yii2. No system requires. yii2-composer support, Less autoupdate, customizing of output directory

  Sources   Download

BSD-3-Clause

The Requires

 

by Alex Sharov

yii2 yii asset converter less sass phamlp

03/08 2014

1.2.1

1.2.1.0

Less, Sass and Phamlp converter for Yii2. No system requires. yii2-composer support, Less autoupdate, customizing of output directory

  Sources   Download

BSD-3-Clause

The Requires

 

by Alex Sharov

yii2 yii asset converter less sass phamlp

06/11 2013

v1.2.0

1.2.0.0

Less, Sass and Phamlp converter for Yii2. No system requires. yii2-composer support, Less autoupdate, customizing of output directory

  Sources   Download

BSD-3-Clause

The Requires

 

by Alex Sharov

yii2 yii asset converter less sass phamlp

06/11 2013

v1.1.9

1.1.9.0

Less, Sass and Phamlp converter for Yii2. No system requires. Fork of https://github.com/athos99/assetparser with Composer support, Less autoupdate by Composer, customizing of output directory

  Sources   Download

BSD-3-Clause

The Requires

 

by Alex Sharov

yii2 yii asset converter less sass phamlp

05/11 2013

v1.1.8

1.1.8.0

Less, Sass and Phamlp converter for Yii2. No system requires. Fork of https://github.com/athos99/assetparser with Composer support, Less autoupdate by Composer, customizing of output directory

  Sources   Download

BSD-3-Clause

The Requires

 

by Alex Sharov

yii2 yii asset converter less sass phamlp

04/11 2013

v1.1.7

1.1.7.0

Less, Sass and Phamlp converter for Yii2. No system requires. Fork of https://github.com/athos99/assetparser with Composer support, Less autoupdate by Composer, customizing of output directory

  Sources   Download

BSD-3-Clause

The Requires

 

by Alex Sharov

yii2 yii asset converter less sass phamlp

28/10 2013

v1.1.6

1.1.6.0

Less, Sass and Phamlp converter for Yii2. No system requires. Fork of https://github.com/athos99/assetparser with Composer support, Less autoupdate by Composer, customizing of output directory

  Sources   Download

BSD-3-Clause

The Requires

 

by Alex Sharov

yii2 yii asset converter less sass phamlp

14/09 2013

v1.1.5

1.1.5.0

Less, Sass and Phamlp converter for Yii2. No system requires. Fork of https://github.com/athos99/assetparser with Composer support, Less autoupdate by Composer, customizing of output directory

  Sources   Download

BSD-3-Clause

The Requires

 

by Alex Sharov

yii2 yii asset converter less sass phamlp

14/09 2013

v1.0.0

1.0.0.0

Less, Sass and Phamlp converter for Yii2. No system requires. Fork of https://github.com/athos99/assetparser with Composer support, Less autoupdate by Composer, customizing of output directory

  Sources   Download

BSD-3-Clause

The Requires

 

by Alex Sharov

yii2 yii asset converter less sass phamlp

14/09 2013

v1.1.0

1.1.0.0

Less, Sass and Phamlp converter for Yii2. No system requires. Fork of https://github.com/athos99/assetparser with Composer support, Less autoupdate by Composer, customizing of output directory

  Sources   Download

BSD-3-Clause

The Requires

 

by Alex Sharov

yii2 yii asset converter less sass phamlp

14/09 2013

v1.1.1

1.1.1.0

Less, Sass and Phamlp converter for Yii2. No system requires. Fork of https://github.com/athos99/assetparser with Composer support, Less autoupdate by Composer, customizing of output directory

  Sources   Download

BSD-3-Clause

The Requires

 

by Alex Sharov

yii2 yii asset converter less sass phamlp

14/09 2013

v1.1.2

1.1.2.0

Less, Sass and Phamlp converter for Yii2. No system requires. Fork of https://github.com/athos99/assetparser with Composer support, Less autoupdate by Composer, customizing of output directory

  Sources   Download

BSD-3-Clause

The Requires

 

by Alex Sharov

yii2 yii asset converter less sass phamlp

14/09 2013

v1.1.4

1.1.4.0

Less, Sass and Phamlp converter for Yii2. No system requires. Fork of https://github.com/athos99/assetparser with Composer support, Less autoupdate by Composer, customizing of output directory

  Sources   Download

BSD-3-Clause

The Requires

 

by Alex Sharov

yii2 yii asset converter less sass phamlp