Welcome to mirror list, hosted at ThFree Co, Russian Federation.

css_flip.js « tasks - github.com/twbs/grunt-css-flip.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 64fb30625c1ab18f56b9833c3f530754e5727ef3 (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
34
/*
 * 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.');
    });
  });
};