New issue

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

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

Already on GitHub? Sign in to your account

CSS minifier issue with rgba(000, 000, 000, 0.7) and variants #5506

Closed
onedrawingperday opened this Issue Dec 6, 2018 · 4 comments

Comments

Projects
None yet
2 participants
@onedrawingperday
Contributor

onedrawingperday commented Dec 6, 2018

This has been reported in the forum and I am seeing the same behavior.

It seems that for any rgba CSS value e.g. rgba(000, 000, 000, 0.7); and also if a color value is set to transparent the minifier outputs invalid hexadecimal numbers that fail W3C validation.

Originally due to lack of time I opened tdewolff/minify#237

However there is already the KeepCSS2 flag that addresses this problem as stated in the minifier's documentation over here: https://github.com/tdewolff/minify#css

I have tested minifying the same CSS file with online version of the minifier and I can confirm that the KeepCSS2 flag fixes the invalid HEX color codes.

Also please note that this is a flag for the CSS minifier and it cannot be added to the existing list with the HTML minifier flags. This flag needs a new list for the CSS minifier.

@bep

This comment has been minimized.

Member

bep commented Dec 6, 2018

I am closing this issue after noticing the KeepCSS2 flag that fixes this behavior.

Re. your comment -- how is that a fix?

@onedrawingperday

This comment has been minimized.

Contributor

onedrawingperday commented Dec 6, 2018

Re. your comment -- how is that a fix?

The flag KeepCSS2 does not convert rgba values to invalid HEX. It keeps them as is. I tested with the online converter I posted about above and noticed that it is in the Minifier's Docs.

I am not going to re-open that issue.

If you feel that the default behavior of the CSS minifier should change feel free to open an issue upstream yourself.

Already spent more time on this than I should.

Also if you feel that this flag should not be added to Hugo feel free to close this issue.

@bep

This comment has been minimized.

Member

bep commented Dec 6, 2018

@bep bep added Upstream Bug labels Dec 6, 2018

@bep bep added this to the v0.53 milestone Dec 6, 2018

@bep bep changed the title from Add KeepCSS2 Flag to CSS minifier to CSS minifier issue with rgba(000, 000, 000, 0.7) and variants Dec 6, 2018

@bep bep closed this in 4b5f743 Dec 7, 2018

@onedrawingperday

This comment has been minimized.

Contributor

onedrawingperday commented Dec 7, 2018

@bep Thank you for commit 4b5f743 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment