Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Added autoprefix task to Grunt - Added autoprefixer to package.json - Added grunt-postcss to package.json - Added 'postcss' task to Grunt which runs autoprefixer - `grunt postcss` runs autoprefixer (we can add more postcss plugins to this process) - Added postcss to grunt build - Moved postcss to run before concat - Changed grunt command from postcss to autoprefix. Added documentation. - Now... `grunt autoprefix` runs autoprefixer

ZachTRicefa6e176e9fc8
diff --git a/Gruntfile.js b/Gruntfile.js
index 37241add0..e9b51ce3a 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -135,6 +135,18 @@ module.exports = function(grunt) {
}
},
+ autoprefix: {
+ options: {
+ map: false,
+ processors: [
+ require('autoprefixer')
+ ]
+ },
+ dist: {
+ src: 'web/css/*.css'
+ }
+ },
+
concat: {
// Combine all the Worldview JavaScript files into one file.
js: {
@@ -664,6 +676,7 @@ module.exports = function(grunt) {
grunt.loadNpmTasks("grunt-markdown");
grunt.loadNpmTasks("grunt-minjson");
grunt.loadNpmTasks("grunt-mkdir");
+ grunt.loadNpmTasks('grunt-postcss');
grunt.loadNpmTasks("grunt-text-replace");
grunt.loadNpmTasks("grunt-rename");
grunt.loadNpmTasks('grunt-nightwatch');
@@ -671,6 +684,7 @@ module.exports = function(grunt) {
// Lets use "clean" as a target instead of the name of the task
grunt.renameTask("clean", "remove");
+ grunt.renameTask("postcss", "autoprefix");
grunt.registerTask("load_branding", "Load branding", function() {
var brand = grunt.file.readJSON("build/options/brand.json");
@@ -702,6 +716,7 @@ module.exports = function(grunt) {
"exec:empty",
"copy:release",
"uglify",
+ "autoprefix",
"cssmin",
"replace:links",
"lineremover",
diff --git a/doc/developing.md b/doc/developing.md
index 32abc6e9e..3b259c11b 100644
--- a/doc/developing.md
+++ b/doc/developing.md
@@ -89,6 +89,15 @@ an edit, issue the following command:
grunt config
+### Autoprefix CSS
+
+Parse all CSS files and automatically add vendor prefixes to CSS rules using values from Can I Use.
+
+Run autoprefix with the following:
+
+ grunt autoprefix
+
+
### Linting
Check for common errors in the JavaScript and CSS files with:
diff --git a/package.json b/package.json
index c364de4c1..2adc0f09b 100644
--- a/package.json
+++ b/package.json
@@ -13,6 +13,7 @@
"start": "node ./bin/www"
},
"devDependencies": {
+ "autoprefixer": "7.1.1",
"babel-polyfill": "6.16.0",
"bluebird": "3.4.6",
"buster": "0.7.12",
@@ -39,6 +40,7 @@
"grunt-minjson": "0.4.x",
"grunt-mkdir": "0.1.x",
"grunt-nightwatch": "^0.5.4",
+ "grunt-postcss": "^0.8.0",
"grunt-rename": "0.1.x",
"grunt-text-replace": "0.4.x",
"jshint": "2.9.x",