GithubHelp home page GithubHelp logo

jetstyle / grunt-styletto Goto Github PK

View Code? Open in Web Editor NEW

This project forked from i-akhmadullin/grunt-styletto

2.0 3.0 1.0 133 KB

Grunt plugin for compiling css with styletto

License: MIT License

JavaScript 100.00%

grunt-styletto's Introduction

grunt-styletto

Grunt plugin for processing CSS with Styletto

Getting Started

Install styletto: npm install styletto -g

Install plugin in your project directory with: npm install grunt-styletto

Then load it from your own grunt.js file:

grunt.loadNpmTasks('grunt-styletto');

Usage

Add styletto task in grunt.js file like this:

styletto: {
  all: {

    // path to input file or array of paths
    src: "blocks/style.css",

    // path to result file
    dest: "blocks/__style.css",

    // optional params, @see for syntax and default settings https://github.com/jetstyle/styletto/blob/master/README.md
    compress: "csso",
    base64: 1500,
    // same but with more control
    //base64: {
    //    limit: 1500,
    //    types: {
    //        'jpeg': 'image/jpeg'
    //    }
    //},
    stylus: {
        variables: { "ie": true },
        imports: [ 'mixin1.styl', 'mixin2.styl' ]
    },
    less: {
        variables: { "bg-color": "red" },
        imports: [ 'lesshat.less' ]
    },
    errors: "alert",
    // same but with more control
    // errors: {
    //   imports: 'alert',
    //   resources: 'alert',
    //   processors: 'alert'
    // },
    path: "../"
  }
},

Then you can run grunt styletto to compile blocks/style.css file with styletto

Documentation

This plugin provides only one task: styletto.

This task is a multi task, so you can run styletto multiple times with different configs, like so:

styletto: {
  dev: {
    src: ['test/all.css'],
    dest: "test/__all.css",
    compress: 'csso',
    errors: "alert"
  },
  publish: {
    src: ['test/all.css'],
    dest: "publish/__deploy.css",
    compress: "yui",
    base64: 15000,
    errors: "alert"
  }
},

To run only one subtask run styletto from console like so: grunt styletto:dev

Contributing

Please use the issue tracker and pull requests.

License

Copyright (c) 2012 ilya.akhmadullin
Licensed under the MIT license.

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.