Giter Club home page Giter Club logo

grunt-stylus's Introduction

Stylus task for Grunt

Warning

This plugin is deprecated. Use grunt-contrib-stylus with Grunt 0.4. It’s more awesome and it should work fine as a drop-in replacement for grunt-stylus.

Installation

Install grunt-stylus:

npm install grunt-stylus

Add somewhere in your grunt.js:

grunt.loadNpmTasks('grunt-stylus');

Inside your grunt.js file add a section named stylus. See Parameters section below for details.

Parameters

files object

Defines what files this task will process and should contain key:value pairs. The key should result CSS files and the value should be a source Stylus filepath. Supports grunt.template.

options object

Controls how this task (and its helpers) operate and should contain key:value pairs, see Options section below.

Options

paths string|array

Specifies directories to scan for @import directives when parsing.

Notes

  • You can specify all other Stylus options you need: eg. include css.

  • Options compress is enabled by default. See section Handling of --debug option below for details.

Config Example

stylus: {
  compile: {
    options: {
      'include css': true,
      'paths': ['path/to/import', 'another/to/import']
    },
    files: {
      'path/to/result.css': 'path/to/source.styl',
      'path/to/another.css': 'path/to/source2.styl'
    }
  }
},

Nib Support

Nib is supported by default. You don’t need to do anything. Just @import 'nib'; anywere you need some nib.

Using Stylus’s url() Function

You can use url() function for embedding images as data:uri. You can define any name for it.

...
options: {
  urlfunc: 'embedurl'
}
...

Now you can write in Stylus files:

E {
  background:embedurl("logo.png");
}

Handling of --debug option

Compression (compress option in Stylus) disables when --debug options for grunt is specified. And enables otherwise.


License

The MIT License, see the included License.md file.

grunt-stylus's People

Contributors

blakeblackshear avatar sapegin avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.