rbtech / gulp-css-purge Goto Github PK
View Code? Open in Web Editor NEWCSS-PURGE now comes in a flavor thats meant to be Gulped
License: MIT License
CSS-PURGE now comes in a flavor thats meant to be Gulped
License: MIT License
I've encountered an issue wherein I'm trying to purge a (third-party) CSS file and I'm getting the following error:
CSS Parser Error: probably have something funny in your CSS, change it then please try again.
Reason: missing '}'
Line: 157
Column: 1
Filename: demo/test1.css
There is no missing } in the line mentioned nor anywhere else in the file as far as I'm aware. The filename is also not demo/test1.css
.
Here is my Gulp code:
const gulp = require('gulp');
const concat = require('gulp-concat');
const streamqueue = require('streamqueue');
const cssPurge = require('gulp-css-purge');
// Concatenate and minify stylesheets
gulp.task('styles', function() {
// inspired by https://stackoverflow.com/a/23507836
return streamqueue({ objectMode: true },
gulp.src('./node_modules/purecss/build/pure.css'),
gulp.src('./static/app.css'),
gulp.src('./node_modules/codemirror/lib/codemirror.css'),
)
.pipe(concat('styles.css'))
.pipe(cssPurge({
trim : true,
shorten : true,
verbose : false
}))
.pipe(gulp.dest('./static'));
});
The problem is with the ./node_modules/codemirror/lib/codemirror.css
file because when I comment this line I can purge the other two without issues. The problem is also not with concatenation or the use of streamqueue because even without it I get the same error.
Now, the following run from CLI works without any problem and produces a valid minified CSS file:
./node_modules/.bin/css-purge -i ./node_modules/codemirror/lib/codemirror.css
Therefore I assume there's a problem in this package and not in css-purge itself.
when hsla() or hsl() is used if the saturation and/or lightness has a value of 0% the output css removes value.
hsla(0, 0%, 60%, 0.6) outputs to hsla(0,, 60%, 0.6)
hsl(123, 10%, 0%) outputs to hsl(123,10%,,)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.