oswaldoacauan / grunt-csscomb

The grunt plugin for sorting CSS properties in specific order.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

grunt-csscomb Build Status NPM version

The grunt plugin for sorting CSS properties in specific order.

Getting Started

This plugin requires Grunt ~0.4.1.

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-csscomb --save-dev

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

grunt.loadNpmTasks('grunt-csscomb');

The "csscomb" task

Overview

In your project's Gruntfile, add a section named csscomb to the data object passed into grunt.initConfig().

grunt.initConfig({
  csscomb: {
    options: {
      // Task-specific options go here.
    },
    your_target: {
      // Target-specific file lists and/or options go here.
    },
  },
})

Options

options.sortOrder

Type: String Default value: null

A string value that is used to specify custom-sort-order.json file path.

Usage Examples

grunt.initConfig({
  foo : {
    files: {
      'dest/resorted-foo.css': ['src/foo.css'],
    },
  },
  bar : {
    files: {
      'dest/resorted-foo.css': ['src/foo.css'],
      'dest/resorted-bar.css': ['src/bar.css'],
    },
  },
})

Custom Options

You can set the sortOrder option if you want to use the order to which you are accustomed to.

grunt.initConfig({
  csscomb: {
    options: {
      sortOrder: '/path/to/custom-sort-order.json'
    },
    files: {
      'dest/resorted-foo.css': ['src/foo.css'],
    },
  },
})

Release History

  • v1.1.0: Improve process.
  • v1.0.0: Support csscomb.js.
  • v0.5.0: Enable multiple files.
  • v0.4.0: Move to csscomb's repository.
  • v0.3.0: Fix sort option bug.
  • v0.2.0: Fix bugs.
  • v0.1.0: Release.

About

The grunt plugin for sorting CSS properties in specific order.

License:MIT License


Languages

Language:JavaScript 85.2%Language:CSS 14.8%