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
Showing with 4 additions and 32 deletions
+4 -32
...@@ -201,7 +201,7 @@ module.exports = function (grunt) { ...@@ -201,7 +201,7 @@ module.exports = function (grunt) {
} }
}, },
cssFlip: { css_flip: {
rtl: { rtl: {
files: { files: {
'dist/css/<%= pkg.name %>-rtl.css': 'dist/css/<%= pkg.name %>.css' 'dist/css/<%= pkg.name %>-rtl.css': 'dist/css/<%= pkg.name %>.css'
...@@ -390,7 +390,6 @@ module.exports = function (grunt) { ...@@ -390,7 +390,6 @@ module.exports = function (grunt) {
// These plugins provide necessary tasks. // These plugins provide necessary tasks.
require('load-grunt-tasks')(grunt, {scope: 'devDependencies'}); require('load-grunt-tasks')(grunt, {scope: 'devDependencies'});
grunt.loadTasks('./grunt/tasks/');
// Docs HTML validation task // Docs HTML validation task
grunt.registerTask('validate-html', ['jekyll', 'validation']); grunt.registerTask('validate-html', ['jekyll', 'validation']);
...@@ -419,7 +418,7 @@ module.exports = function (grunt) { ...@@ -419,7 +418,7 @@ module.exports = function (grunt) {
// CSS distribution task. // CSS distribution task.
grunt.registerTask('less-compile', ['less:compileCore', 'less:compileTheme']); 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. // Docs distribution task.
grunt.registerTask('dist-docs', 'copy:docs'); 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 @@ ...@@ -8,7 +8,6 @@
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~"], "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~"],
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
"disallowTrailingWhitespace": true, "disallowTrailingWhitespace": true,
"requireCamelCaseOrUpperCaseIdentifiers": true,
"requireLeftStickedOperators": [","], "requireLeftStickedOperators": [","],
"requireLineFeedAtFileEnd": true, "requireLineFeedAtFileEnd": true,
"requireRightStickedOperators": ["!"], "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