|
1 | | -# css-compiler |
2 | | -compiles SASS/LESS and Compass, available though Composer |
| 1 | +[](https://packagist.org/packages/eugene-matvejev/css-compiler) |
| 2 | +[](https://packagist.org/packages/eugene-matvejev/css-compiler) |
| 3 | +[](https://packagist.org/packages/eugene-matvejev/css-compiler) |
| 4 | +[](https://packagist.org/packages/eugene-matvejev/css-compiler) |
| 5 | + |
| 6 | + |
| 7 | +# PHP CSS Compiler |
| 8 | +_can be triggered from composer's script's section: compiles LESS|SASS|Compass_ |
| 9 | + |
| 10 | +# How to use: |
| 11 | +``` |
| 12 | +composer require "eugene-matvejev/css-compiler" |
| 13 | +``` |
| 14 | +if you have problem with min-stability you can use this solution in '_require(-dev)_': |
| 15 | +_example_: |
| 16 | +``` |
| 17 | +"require": { |
| 18 | + "eugene-matvejev/css-compiler": "^0.1", |
| 19 | + "leafo/scssphp-compass": "@dev", |
| 20 | + "leafo/scssphp": "@dev" |
| 21 | +} |
| 22 | +``` |
| 23 | + |
| 24 | +### add callback into into composer's __scripts__: |
| 25 | +``` |
| 26 | +"EM\\CssCompiler\\Handler\\ScriptHandler::compileCSS" |
| 27 | +``` |
| 28 | +_example_: |
| 29 | +``` |
| 30 | +"scripts": { |
| 31 | + "post-update-cmd": "@custom-events", |
| 32 | + "post-install-cmd": "@custom-events", |
| 33 | + "custom-events": [ |
| 34 | + "EM\\CssCompiler\\Handler\\ScriptHandler::compileCSS" |
| 35 | + ] |
| 36 | +} |
| 37 | +``` |
| 38 | +### add _css-compiler_ information inside of the _extra_ composer configuration |
| 39 | + * _format_: compression format |
| 40 | + * _input_: array of relative paths to the composer.json, all files will be picked up recursivly inside of the directory |
| 41 | + * _output_: relative file path to the composer.json, where to save output (hard-copy) |
| 42 | + |
| 43 | +_example_: |
| 44 | +``` |
| 45 | +"extra": { |
| 46 | + "css-compiler": [ |
| 47 | + { |
| 48 | + "format": "compact", |
| 49 | + "input": [ |
| 50 | + "tests/shared-fixtures/scss" |
| 51 | + ], |
| 52 | + "output": "var/cache/assets/scss.css" |
| 53 | + }, |
| 54 | + { |
| 55 | + "format": "compact", |
| 56 | + "input": [ |
| 57 | + "tests/shared-fixtures/sass" |
| 58 | + ], |
| 59 | + "output": "var/cache/assets/sass.css" |
| 60 | + }, |
| 61 | + { |
| 62 | + "format": "compact", |
| 63 | + "input": [ |
| 64 | + "tests/shared-fixtures/compass/app.scss" |
| 65 | + ], |
| 66 | + "output": "var/cache/assets/compass.css" |
| 67 | + } |
| 68 | + ] |
| 69 | +} |
| 70 | +``` |
0 commit comments