Last active
May 31, 2018 10:41
-
-
Save PhilippeVay/55a9d4bc0504f860e2f7caf521efbee9 to your computer and use it in GitHub Desktop.
cssbeautify bug with quotes and is it doing anything in at-media at-rules ?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* jshint node: true */ | |
'use strict'; | |
var gulp = require('gulp'), | |
$ = require('gulp-load-plugins')(), | |
atImport = require("postcss-import"); // plugin PostCSS qui "inline" les CSS importées depuis la feuille de style principale (équivalent à une concaténation en plus souple) | |
var project = { | |
configuration: { | |
browsersList: [ '> 1%', 'last 2 versions', 'IE >= 11', 'Edge >= 12'], | |
cssbeautify: { | |
indent: '(indent)', | |
}, | |
}, | |
}; | |
/** | |
* Chemins vers les ressources ciblées | |
*/ | |
var paths = { | |
src: './src/', // dossier de travail | |
dest: './dist/', // dossier destiné à la livraison | |
styles: { | |
root: 'assets/css/', // répertoire contenant le(s) fichier(s) CSS | |
cssSrc: { | |
mainFile: 'assets/css/style.css', // fichier CSS principal | |
files: 'assets/css/{,*/}*.css', // fichiers CSS à surveiller (css/ et tous ses sous-répertoires) | |
}, | |
}, | |
}; | |
var onError = { | |
errorHandler: function (err) { | |
console.log(err); | |
this.emit('end'); | |
} | |
}; | |
gulp.task('css', function () { | |
const plugins = [ | |
atImport() | |
]; | |
return gulp.src(paths.src + paths.styles.cssSrc.mainFile) | |
.pipe($.plumber(onError)) | |
.pipe($.postcss(plugins)) | |
.pipe($.cssbeautify(project.configuration.cssbeautify)) | |
.pipe($.autoprefixer( {browsers: project.configuration.browsersList} )) | |
.pipe(gulp.dest(paths.dest + paths.styles.root)); | |
}); | |
gulp.task('build', ['css']); | |
gulp.task('default', ['build']); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "cssbeautify-bug-quote", | |
"version": "0.0.1", | |
"description": "Quote in comments has an influence on cssbeautify", | |
"dependencies": { | |
"gulp": "^3.x", | |
"gulp-autoprefixer": "^4.x", | |
"gulp-concat": "^2.x", | |
"gulp-cssbeautify": "latest", | |
"gulp-csscomb": "^3.x", | |
"gulp-load-plugins": "^1.x", | |
"gulp-plumber": "^1.x", | |
"gulp-postcss": "latest", | |
"postcss-import": "latest" | |
}, | |
"repository": { | |
"type": "git", | |
"url": "http://domain.com/repo/lol" | |
}, | |
"keywords": [ | |
"gulp", | |
"static" | |
], | |
"author": "PhilippeVay", | |
"license": "MIT", | |
"bugs": { | |
"url": "http://domain.com/repo/lol/issues" | |
}, | |
"homepage": "http://domain.com/repo/lol" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.selector1 { display: block; } | |
.selectorX { | |
display: grid; } | |
@media (min-width: 100px) { /* l'apostrophe */ .selector1 { display: block; } | |
.selectorY { display: flex; } | |
.selectorZ { | |
color: red; | |
} | |
} | |
.sel-intercalaire { | |
transition: all; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import "_template/_header.css"; | |
@import "_template/_navigation.css"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment