Skip to content

Commit

Permalink
Generate Grids Units via Grunt task
Browse files Browse the repository at this point in the history
  • Loading branch information
ericf committed Nov 18, 2013
1 parent 5cec523 commit dfff4fe
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 175 deletions.
8 changes: 8 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,13 @@ grunt.initConfig({
}
},

// -- Grid Units Config ----------------------------------------------------

grid_units: {
dest : 'build/grids-units.css',
units: 24
},

// -- CSS Selectors Config -------------------------------------------------

css_selectors: {
Expand Down Expand Up @@ -233,6 +240,7 @@ grunt.registerTask('build', [
'clean:build',
'copy:build',
'css_selectors:base',
'grid_units',
'concat:build',
'clean:build_res',
'cssmin',
Expand Down
175 changes: 0 additions & 175 deletions src/grids/css/grids-units.css

This file was deleted.

14 changes: 14 additions & 0 deletions tasks/grid_units.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
'use strict';

var rework = require('rework'),
pureGrids = require('rework-pure-grids');

module.exports = function (grunt) {
grunt.registerTask('grid_units', 'Generates grid units.', function (target) {
var config = grunt.config.get(this.name),
css = rework('').use(pureGrids.units(config.units));

grunt.file.write(config.dest, css.toString({indent: ' '}));
grunt.log.writeln('File "' + config.dest + '" created.');
});
};

0 comments on commit dfff4fe

Please sign in to comment.