Skip to content

Commit dfff4fe

Browse files
committed
Generate Grids Units via Grunt task
1 parent 5cec523 commit dfff4fe

File tree

3 files changed

+22
-175
lines changed

3 files changed

+22
-175
lines changed

Gruntfile.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,13 @@ grunt.initConfig({
184184
}
185185
},
186186

187+
// -- Grid Units Config ----------------------------------------------------
188+
189+
grid_units: {
190+
dest : 'build/grids-units.css',
191+
units: 24
192+
},
193+
187194
// -- CSS Selectors Config -------------------------------------------------
188195

189196
css_selectors: {
@@ -233,6 +240,7 @@ grunt.registerTask('build', [
233240
'clean:build',
234241
'copy:build',
235242
'css_selectors:base',
243+
'grid_units',
236244
'concat:build',
237245
'clean:build_res',
238246
'cssmin',

src/grids/css/grids-units.css

Lines changed: 0 additions & 175 deletions
This file was deleted.

tasks/grid_units.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
'use strict';
2+
3+
var rework = require('rework'),
4+
pureGrids = require('rework-pure-grids');
5+
6+
module.exports = function (grunt) {
7+
grunt.registerTask('grid_units', 'Generates grid units.', function (target) {
8+
var config = grunt.config.get(this.name),
9+
css = rework('').use(pureGrids.units(config.units));
10+
11+
grunt.file.write(config.dest, css.toString({indent: ' '}));
12+
grunt.log.writeln('File "' + config.dest + '" created.');
13+
});
14+
};

0 commit comments

Comments
 (0)