Skip to content

Commit

Permalink
Add Autoprefixer (#113)
Browse files Browse the repository at this point in the history
* readme tweaks

* Add autoprefixer to package.json

* Autoprefixer

* run the jsuglify task first when compiling

* Oops, add to default task too
  • Loading branch information
C-Lodder authored and Dimitri Grammatikogianni committed Nov 2, 2016
1 parent e9928ee commit a78e3d4
Show file tree
Hide file tree
Showing 5 changed files with 371 additions and 193 deletions.
24 changes: 20 additions & 4 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ module.exports = function(grunt) {
}
},

// CSS build configuration
// Validate the SCSS
scsslint: {
allFiles: [
'<%= folder.adminTemplate %>/scss',
Expand Down Expand Up @@ -326,6 +326,19 @@ module.exports = function(grunt) {
}
},

// Initiate task after CSS is generated
postcss: {
options: {
map: false,
processors: [
require('autoprefixer')({browsers: 'last 2 versions'})
],
},
dist: {
src: '<%= folder.adminTemplate %>/css/template.css'
}
},

// Let's minify some css files
cssmin: {
allCss: {
Expand All @@ -343,9 +356,9 @@ module.exports = function(grunt) {
expand: true,
matchBase: true,
ext: '.min.css',
cwd: 'administrator/templates/atum/css',
cwd: '<%= folder.adminTemplate %>/css',
src: ['*.css', '!*.min.css', '!theme/*.css'],
dest: 'administrator/templates/atum/css',
dest: '<%= folder.adminTemplate %>/css',
}]
}
}
Expand All @@ -363,6 +376,7 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-zip');
grunt.loadNpmTasks('grunt-curl');
grunt.loadNpmTasks('grunt-fetch-pages');
grunt.loadNpmTasks('grunt-postcss');

grunt.registerTask('default',
[
Expand All @@ -378,6 +392,7 @@ module.exports = function(grunt) {
'sass:dist',
'uglify:allJs',
'cssmin:allCss',
'postcss',
'cssmin:templates',
'clean:temp'
]
Expand Down Expand Up @@ -405,9 +420,10 @@ module.exports = function(grunt) {

grunt.registerTask('compile', 'Compiles the stylesheet files.', function() {
grunt.task.run([
'uglify:templates',
'scsslint',
'sass:dist',
'uglify:templates',
'postcss',
'cssmin:templates'
]);
});
Expand Down
Loading

0 comments on commit a78e3d4

Please sign in to comment.