GithubHelp home page GithubHelp logo

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: {

    // optional params, @see for syntax and default settings https://github.com/jetstyle/styletto/blob/master/README.md
    options: {
      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: "../"
    }

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

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

  }
},

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.

grunt-styletto's People

Contributors

i-akhmadullin avatar sladex avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

grunt-styletto's Issues

Проблемы с компиляцией less последнего bootstap v3.1.1

Проблемы с компиляцией less последнего bootstap v3.1.1

Error! ParseError: Syntax Error on line 643 in assets\bootstrap\less\mixins.less
padding-right: (@grid-gutter-width / 2);
&:extend(.clearfix all);
}

Cкорей всего из-за нового свойства extend в препроцесоре less. Компилятор less используемый в утиле styletto не можеть скомпилировать

Grunt 0.4 Release

I'm posting this issue to let you know that we will be publishing Grunt 0.4 on Monday, February 18th.

If your plugin is not already Grunt 0.4 compatible, would you please consider updating it? For an overview of what's changed, please see our migration guide.

If you'd like to develop against the final version of Grunt before Monday, please specify "grunt": "0.4.0rc8" as a devDependency in your project. After Monday's release, you'll be able to use "grunt": "~0.4.0" to actually publish your plugin. If you depend on any plugins from the grunt-contrib series, please see our list of release candidates for compatible versions. All of these will be updated to final status when Grunt 0.4 is published.

Also, in an effort to reduce duplication of effort and fragmentation in the developer community, could you review the grunt-contrib series of plugins to see if any of your functionality overlaps significantly with them? Grunt-contrib is community maintained with 40+ contributors—we'd love to discuss any additions you'd like to make.

Finally, we're working on a new task format that doesn't depend on Grunt: it's called node-task. Once this is complete, there will be one more conversion, and then we'll never ask you to upgrade your plugins to support our changes again. Until that happens, thanks for bearing with us!

If you have any questions about how to proceed, please respond here, or join us in #grunt on irc.freenode.net.

Thanks, we really appreciate your work!

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.