laravel-elixir-stylus
Advanced tools
Comparing version 1.0.1 to 2.0.0
var gulp = require('gulp'); | ||
var postStylus = require('poststylus'); | ||
var Elixir = require('laravel-elixir'); | ||
var compile = require('laravel-elixir/tasks/shared/Css'); | ||
var compile = require('laravel-elixir/dist/tasks/shared/Css').default; | ||
@@ -6,0 +6,0 @@ var config = Elixir.config; |
{ | ||
"name": "laravel-elixir-stylus", | ||
"version": "1.0.1", | ||
"version": "2.0.0", | ||
"description": "Laravel Elixir Stylus Extension", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
## Usage | ||
This is a simple wrapper around Laravel Elixir. Add it to your Elixir-enhanced Gulpfile, like so: | ||
This Laravel Elixir extension allows you to compile Stylus. | ||
## Installation | ||
First, pull in the extension through NPM. | ||
``` | ||
npm install --save-dev laravel-elixir-stylus | ||
``` | ||
Next, add it to your Elixir-enhanced Gulpfile, like so: | ||
```js | ||
var elixir = require('laravel-elixir'); | ||
@@ -11,16 +21,46 @@ | ||
elixir(function(mix) { | ||
mix.stylus(); | ||
mix.stylus('app.styl'); | ||
}); | ||
``` | ||
This will scan your `resources/assets/stylus` directory for all files. Instead, if you only want to compile a single file, you may do: | ||
That's it! You're all set to go! | ||
## Usage | ||
Assuming you write... | ||
```js | ||
elixir(function(mix) { | ||
mix.stylus('app.styl'); | ||
}); | ||
``` | ||
mix.stylus("bootstrap.styl"); | ||
...this will compile your `resources/assets/stylus/app.styl` file to `./public/css/app.css`. | ||
If you'd like to set a different output directory, you may pass a second argument to the `stylus()` method, like so: | ||
```js | ||
mix.stylus('app.styl', './public/scripts/styles.css') | ||
``` | ||
Finally, if you'd like to output to a different directory than the default `public/css`, then you may override this as well. | ||
Finally, if you want to override the Stylus plugin options, you may pass an object as the third argument. | ||
```js | ||
mix.stylus('app.styl', null, {}); | ||
// See options at: https://www.npmjs.com/package/gulp-stylus#options | ||
``` | ||
mix.stylus("bootstrap.styl", "public/css/foo/bar/"); | ||
## PostCSS | ||
This extension includes a PostCSS adapter out of the box, as well as support for the incredibly impressive [Lost](https://github.com/corysimmons/lost) grid system. Check out the documentation in that link, and immediately start using it in your projects with this extension. Zero setup. :) | ||
If there are other PostCSS plugins you want to pull in, you may use the third argument to `mix.stylus()` - | ||
```js | ||
var postStylus = require('poststylus'); // npm install --save-dev poststylus | ||
mix.stylus('app.styl', null, { | ||
use: [postStylus(['lost', 'postcss-position'])] | ||
}); | ||
``` |
3910
66