blob: 2d7d9ac3baa7c283835e9d08e7870d80b21a3860 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
/*
* grunt-css-flip
* https://github.com/twbs/grunt-css-flip
*
* Copyright (c) 2014 Chris Rebert
* Licensed under the MIT License.
*/
'use strict';
var flip = require('css-flip');
module.exports = function (grunt) {
grunt.registerMultiTask('cssflip', 'Grunt plugin for Twitter\'s css-flip', function () {
var options = this.options({});
this.files.forEach(function (f) {
var originalCss = grunt.file.read(f.src);
var flippedCss = null;
try {
flippedCss = flip(originalCss, options);
}
catch (err) {
grunt.fail.warn(err);
}
grunt.file.write(f.dest, flippedCss);
grunt.log.writeln('File "' + f.dest.cyan + '" created.');
});
});
};
|