/laravel-elixir-postcss

Laravel Elixir PostCSS Extension

Primary LanguageJavaScriptMIT LicenseMIT

laravel-elixir-postcss

(Support for Elixir V5) Laravel Elixir PostCSS Extension.

Install

$ npm install laravel-elixir-postcss --save-dev

Usage

elixir.postcss(src:'app.css', options);

Example:

var elixir = require('laravel-elixir');

require('laravel-elixir-postcss');

elixir(function(mix) {
  
  //app.css, *.css, **/*.css    
  mix.postcss('app.css', {
    plugins:[ //postcss's plugins
      require('postcss-nested')
    ] 
  });

});

Or run PostCSS with csstyle:

...

elixir(function(mix) {
  
  mix.postcss('app.css', {
    plugins:[ 
      require('postcss-nested'),
      require('csstyle')
    ] 
  });

});

Then run:

$ gulp

Or run gulp watch

Default Options

{
  output  : 'public/css',
  plugins : [],
  srcDir  : 'resources/assets/postcss/',
  sourcemaps: true, // default value follow `elixir.config.sourcemaps`
}

Todo

  1. Add Unit Test
  2. Integrate CI