Commit dec1c21e authored by Chris Rebert's avatar Chris Rebert
Browse files

Merge pull request #12949 from twbs/use-our-grunt-plugin

switch to grunt-css-flip for RTL CSS generation
parents af5a2197 c0447026
3 merge requests!28721Hot test,!22103test,!25326Adjust examples
Showing with 4 additions and 32 deletions
+4 -32
......@@ -201,7 +201,7 @@ module.exports = function (grunt) {
}
},
cssFlip: {
css_flip: {
rtl: {
files: {
'dist/css/<%= pkg.name %>-rtl.css': 'dist/css/<%= pkg.name %>.css'
......@@ -390,7 +390,6 @@ module.exports = function (grunt) {
// These plugins provide necessary tasks.
require('load-grunt-tasks')(grunt, {scope: 'devDependencies'});
grunt.loadTasks('./grunt/tasks/');
// Docs HTML validation task
grunt.registerTask('validate-html', ['jekyll', 'validation']);
......@@ -419,7 +418,7 @@ module.exports = function (grunt) {
// CSS distribution task.
grunt.registerTask('less-compile', ['less:compileCore', 'less:compileTheme']);
grunt.registerTask('dist-css', ['less-compile', 'cssFlip', 'less:minify', 'cssmin', 'csscomb', 'usebanner']);
grunt.registerTask('dist-css', ['less-compile', 'css_flip', 'less:minify', 'cssmin', 'csscomb', 'usebanner']);
// Docs distribution task.
grunt.registerTask('dist-docs', 'copy:docs');
......
/*!
* Bootstrap Grunt task for generating RTL CSS from LTR CSS using css-flip
* http://getbootstrap.com
* Copyright 2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
'use strict';
var flip = require('css-flip');
module.exports = function(grunt) {
grunt.registerMultiTask('cssFlip', 'Generates RTL CSS from LTR CSS using css-flip', function () {
this.files.forEach(function (f) {
var unflippedCss = grunt.file.read(f.src);
var flippedCss = null;
try {
flippedCss = flip(unflippedCss);
}
catch (err) {
grunt.fail.warn(err);
}
grunt.file.write(f.dest, flippedCss);
grunt.log.writeln('File ' + f.dest.cyan + ' created.');
});
});
};
......@@ -8,7 +8,6 @@
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~"],
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
"disallowTrailingWhitespace": true,
"requireCamelCaseOrUpperCaseIdentifiers": true,
"requireLeftStickedOperators": [","],
"requireLineFeedAtFileEnd": true,
"requireRightStickedOperators": ["!"],
......
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment