Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Hex colors in gradients may not be shrinked properly (regressed since 4.1.5) #959

Closed
ngyikp opened this issue Jul 16, 2017 · 2 comments
Closed
Labels
Milestone

Comments

@ngyikp
Copy link
Contributor

ngyikp commented Jul 16, 2017

Not a serious bug, but more of a degradation

Configuration options

const CleanCSS = require('clean-css');
const fs = require('fs');

const input = fs.readFileSync('test.css', 'utf-8');
console.log(new CleanCSS().minify(input).styles);

Input CSS

.a {background-image:linear-gradient(to top, #AABBCC, #ffffff);}
.b {background-image:linear-gradient(to top, #AABBCC, #FFFFFF);}

Actual output CSS

.a{background-image:linear-gradient(to top,#abc,#ffffff)}
.b{background-image:linear-gradient(to top,#abc,#fffFFF)}

Expected output CSS

.a,.b{background-image:linear-gradient(to top,#abc,#fff)}

Hex colors in gradients are failing to shrink and some weird capitalisation if they are uppercase.

@jakubpawlowicz
Copy link
Collaborator

This is weird indeed. Thanks for catching it!

@jakubpawlowicz jakubpawlowicz added this to the 4.1.8 milestone Jul 23, 2017
jakubpawlowicz added a commit that referenced this issue Sep 2, 2017
jakubpawlowicz added a commit that referenced this issue Sep 2, 2017
@jakubpawlowicz
Copy link
Collaborator

Thanks @ngyikp, it's fixed in 4.1.8.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants