GithubHelp home page GithubHelp logo

rbtech / gulp-css-purge Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 1.0 206 KB

CSS-PURGE now comes in a flavor thats meant to be Gulped

License: MIT License

JavaScript 100.00%
gulp gulp-plugin css-purge remove-duplicates minify-css clean-css

gulp-css-purge's Issues

Purge works with CLI but not Gulp

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.

hsla saturation and lightness

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%,,)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.