grunt-cbr-styles-bundles

Compiles LESS bundles from project's blocks library.

npm install grunt-cbr-styles-bundles
13 downloads in the last week
23 downloads in the last month

grunt-cbr-styles-bundles

  1. Look for bundles configs (<%= paths.styles.src %>/bundles/**.json)
  2. Look for dependencies like mixins <%= paths.styles.src %>/bundles/dependencies.json
  3. Find LESS blocks in the project library (<%= paths.styles.src %>/blocks/) and create CSS for every bundles

It's recommended to put blocks that are used on almost all pages in shared.json bundle.

The task will put CSS files in <%= paths.styles.src %> directory and LESS files in <%= paths.styles.src %>/__build directory.

No options so far.

Installation

grunt.loadNpmTasks('grunt-cbr-styles-bundles');

Convention

_ prefix: file is generated and uglified/compressed automatically __ prefix: file is generated automatically but NOT uglified/compressed

Dependencies

LESS and concat tasks

Example

dependencies.json (automatically included in all bundles)

{ "blocks": [ "../__paths.less", "../variables.less", "../mixins.less" ] }

shared.json

{ "blocks": [ "../reset.less", "../fonts.less", "../globals.less", "../layout.less",

    "header/main.less",
    "social-buttons/main.less",
    "footer/main.less"
]

}

The task will create:

/__build/__shared.less
_shared.css   # compressed CSS
__shared.css
npm loves you