npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

grunt-cssondiet

v0.1.5

Published

Easy and fast CSS preprocessor

Readme

grunt-cssondiet

Grunt plugin which compiles CSS-On-Diet files to CSS.

"cssondiet" Grunt Task

This plugin can be installed in your project directory by this command:

npm install grunt-cssondiet --save-dev

But it requires CSS-On-Diet preprocessor, which can be installed like this:

pip install CSSOnDiet

On some system that command (pip) will not be present. It should be installed with not too old Python version. But if you have old version install it from here.

If you are new to Grunt check out Introduction page

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-cssondiet');

The CSS-On-Diet preprocessor

CSS-On-Diet is a preprocessor for CSS files. The key feature is mnemonics for frequently used properties, which are similar to Emmet abbreviations. Other goodies include intuitive media breakpoints, nested and single line comments, variables and mixins, a calculator, hexadecimal RGBA, minifier, ...

This task requires you to have Python and CSS-On-Diet installed. If you're on OS X or Linux you probably already have Python installed; test with python -V in your terminal. When you've confirmed you have Python installed, run pip install CSSOnDiet to install CSS-On-Diet. Maybe you will need to install pip command before.

Examples

Example config

module.exports = function(grunt) {
  grunt.initConfig({

    cssondiet: {                         // Task
      dist: {                            // Target
        options: {                       // Target options
          minifyCss: true       
        },
        files: {                         // Dictionary of files
          'main.css': 'main.cod',        // 'destination': 'source' 
          'widgets.css': 'widgets.cod'
        }
      }
    }

  });

  grunt.loadNpmTasks('grunt-cssondiet');

  grunt.registerTask('default', ['cssondiet']);

};

Compile from multiple sources

CSS-On-Diet concatenates all source files, like they were included in some root-meta file

grunt.initConfig({

  cssondiet: {
    dist: {
      files: {
        'main.css': [ 'main.cod', 'side.cod' ]
      }
    }
  }

});

Options

minifyCss

Type: Boolean
Default: false

Minifies final CSS file.

includeDirs

Type: Array of Strings

Additional directories paths to look for imported files (@cod-include rule).

noComments

Type: Boolean
Default: false

Extract comments from final CSS. Always enabled for minify-css option.

noHeader

Type: Boolean
Default: false

Don't add header line (banner) at the beginning of the CSS. Always enabled for minify-css option.

Release History

  • 2015-05-06 v0.1.5 Installation issue with COD1.8
  • 2014-12-03 v0.1.4 Mnemonics updated
  • 2014-10-29 v0.1.3 A new website link.
  • 2014-07-24 v0.1.2 Documentation update.
  • 2014-07-15 v0.1.1 Better warning messages.
  • 2014-07-11 v0.1.0 Initial