mirror of
https://github.com/twbs/bootstrap.git
synced 2022-11-09 12:25:43 -05:00
switch to grunt-css-flip for RTL CSS generation
This commit is contained in:
parent
af5a219718
commit
56a5d93b82
4 changed files with 4 additions and 31 deletions
|
@ -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');
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
/*!
|
||||
* 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.');
|
||||
});
|
||||
});
|
||||
};
|
|
@ -47,6 +47,7 @@
|
|||
"grunt-contrib-qunit": "~0.4.0",
|
||||
"grunt-contrib-uglify": "~0.4.0",
|
||||
"grunt-contrib-watch": "~0.5.3",
|
||||
"grunt-css-flip": "^0.1.0",
|
||||
"grunt-csscomb": "~2.0.1",
|
||||
"grunt-exec": "~0.4.5",
|
||||
"grunt-html-validation": "~0.1.13",
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue