]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
In the customizer, flip the dir attribute of <html> if RTL is enabled in Sass
authorGeoff Kimball <geoff@zurb.com>
Fri, 11 Mar 2016 22:29:42 +0000 (14:29 -0800)
committerGeoff Kimball <geoff@zurb.com>
Fri, 11 Mar 2016 22:29:42 +0000 (14:29 -0800)
customizer/index.html
gulp/customizer.js
package.json

index 731e2639c19bc11073e22a56c4ac627201695fa6..0ecdf7e1bb46e7023101ff8e35e859f2617b3bf8 100644 (file)
@@ -1,5 +1,5 @@
 <!doctype html>
-<html class="no-js" lang="en">
+<html class="no-js" lang="en" dir="ltr">
   <head>
     <meta charset="utf-8">
     <meta http-equiv="x-ua-compatible" content="ie=edge">
index 364557c58001c32f0c633c75efce768a3bd8e19a..1010986ffdccdeaa83dcd9ca9622e20fbaa9525e 100644 (file)
@@ -5,8 +5,10 @@ var customizer = require('../customizer/lib');
 var File = require('vinyl');
 var fs = require('fs');
 var gulp = require('gulp');
+var If = require('gulp-if');
 var path = require('path');
 var Readable = require('stream').Readable;
+var replace = require('gulp-replace');
 var rename = require('gulp-rename');
 var sass = require('gulp-sass');
 var source = require('vinyl-source-stream');
@@ -18,6 +20,7 @@ var yargs = require('yargs');
 var ARGS = require('yargs').argv;
 var CUSTOMIZER_CONFIG;
 var MODULE_LIST;
+var VARIABLE_LIST;
 
 // Load the configuration file for the customizer. It's a list of modules to load and Sass variables to override
 gulp.task('customizer:loadConfig', function() {
@@ -78,7 +81,10 @@ gulp.task('customizer:javascript', ['customizer:loadConfig'], function() {
 
 // Copies the boilerplate index.html to the custom download folder
 gulp.task('customizer:html', ['customizer:loadConfig'], function() {
+  var rtlEnabled = VARIABLE_LIST['global-text-direction'] && VARIABLE_LIST['global-text-direction'] === 'rtl';
+
   return gulp.src('customizer/index.html')
+    .pipe(If(rtlEnabled, replace('ltr', 'rtl')))
     .pipe(gulp.dest('.customizer'));
 });
 
index df1e97839a09f65e2a9243a58a4cce4423701f11..9a99e2b52c52b806c832fd70099efb16b9b4a0bd 100644 (file)
@@ -46,6 +46,7 @@
     "gulp-cssnano": "^2.1.0",
     "gulp-eslint": "^2.0.0",
     "gulp-filter": "^3.0.1",
+    "gulp-if": "^2.0.0",
     "gulp-load-plugins": "^1.2.0",
     "gulp-mocha": "^2.2.0",
     "gulp-newer": "^1.1.0",