]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
refactor: move all browserlist configs to ".browserslistrc" 11316/head
authorNicolas Coden <nicolas@ncoden.fr>
Sat, 2 Jun 2018 19:03:50 +0000 (21:03 +0200)
committerNicolas Coden <nicolas@ncoden.fr>
Sat, 2 Jun 2018 19:03:50 +0000 (21:03 +0200)
Note: browserlist config is kept in ".babelrc" because browserlist external config is not supported by Babel < 7. See https://github.com/browserslist/browserslist

docs/assets/img/gulpfile.js
gulp/config.js
gulp/tasks/check.js
gulp/tasks/customizer.js
gulp/tasks/sass.js

index 29df4da6dd034ac1cc083df9573f3256edbfd3a7..00870f7d54abcb4f44010426879f565dd11a8350 100755 (executable)
@@ -83,9 +83,7 @@ gulp.task('sass', function() {
       outputStyle: isProduction ? 'compressed' : 'nested'
     })
       .on('error', $.sass.logError))
-    .pipe($.autoprefixer({
-      browsers: ['last 2 versions', 'ie >= 9', 'android >= 4.4', 'ios >= 7']
-    }))
+    .pipe($.autoprefixer()) // uses ".browserslistrc"
     // .pipe(uncss)
     .pipe(gulp.dest('./dist/assets/css'));
 });
index 55f00cefffc0537b46e5defbea70602e0aca9ba9..7383ba09b26e5daca92345dc4c88f6d78ebf4d6c 100644 (file)
@@ -45,13 +45,6 @@ module.exports = {
     'scss/**/*.scss',
   ],
 
-  CSS_COMPATIBILITY: [
-    'last 2 versions',
-    'ie >= 9',
-    'android >= 4.4',
-    'ios >= 7'
-  ],
-
   // Assets
   ASSETS_FILES: [
     'docs/assets/**/*',
index 2ae9b419dd9e141513741d506f6a3b8de90e1249..ac44053d92a4600e45105842d22454d44e267d47 100644 (file)
@@ -20,7 +20,7 @@ gulp.task('check:deps', function() {
 gulp.task('check:browserSupport', function() {
   return gulp.src(['_build/assets/css/foundation.css'])
     .pipe(postcss([doiuse({
-      browsers: CONFIG.CSS_COMPATIBILITY,
+      /* browsers: uses ".browserslistrc" */
       onFeatureUsage: function (usageInfo) {
         console.log(usageInfo.message)
       }
index 6740487b82c8c4ff07319c7bfa7b0ba10249aacf..5e189acdf6d941295c0bed7f4c60ad4ea93c294c 100644 (file)
@@ -30,12 +30,6 @@ var utils = require('../utils.js');
 var ARGS = yargs.argv;
 var FOUNDATION_VERSION = require('../../package.json').version;
 var OUTPUT_DIR = ARGS.output || 'custom-build';
-var COMPATIBILITY = [
-  'last 2 versions',
-  'ie >= 9',
-  'android >= 4.4',
-  'ios >= 7'
-];
 var CUSTOMIZER_CONFIG;
 var MODULE_LIST;
 var VARIABLE_LIST;
@@ -102,9 +96,7 @@ gulp.task('customizer:sass', function(done) {
           'node_modules/motion-ui/src'
         ]
       }))
-      .pipe(postcss([autoprefixer({
-        browsers: COMPATIBILITY
-      })]))
+      .pipe(postcss([autoprefixer()])) // uses ".browserslistrc"
       .pipe(gulp.dest(path.join(OUTPUT_DIR, 'css')))
       .pipe(cleancss({ compatibility: 'ie9' }))
       .pipe(rename('foundation.min.css'))
index fcb2c37530f0dfcadcefa69dc5ccc080d1a0d756..fc4ccdb454077244647d1c400134c4cf20e82a68 100644 (file)
@@ -31,9 +31,7 @@ gulp.task('sass:foundation', ['sass:deps'], function() {
     .pipe(sourcemaps.init())
     .pipe(plumber())
     .pipe(sass().on('error', sass.logError))
-    .pipe(postcss([autoprefixer({
-      browsers: CONFIG.CSS_COMPATIBILITY
-    })]))
+    .pipe(postcss([autoprefixer()])) // uses ".browserslistrc"
     .pipe(sourcemaps.write('.'))
     .pipe(gulp.dest('_build/assets/css'))
     .on('finish', function() {
@@ -52,9 +50,7 @@ gulp.task('sass:docs', ['sass:deps'], function() {
     .pipe(sass({
       includePaths: CONFIG.SASS_DOC_PATHS
     }).on('error', sass.logError))
-    .pipe(postcss([autoprefixer({
-      browsers: CONFIG.CSS_COMPATIBILITY
-    })]))
+    .pipe(postcss([autoprefixer()])) // uses ".browserslistrc"
     .pipe(sourcemaps.write('.'))
     .pipe(gulp.dest('_build/assets/css'));
 });