Skip to content
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 · 5 comments
Closed

Comments

@onedrawingperday
Copy link
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
Copy link
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
Copy link
Contributor Author

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
Copy link
Member

bep commented Dec 6, 2018

tdewolff/minify#238

@bep bep added this to the v0.53 milestone Dec 6, 2018
@bep bep changed the title Add KeepCSS2 Flag to CSS minifier CSS minifier issue with rgba(000, 000, 000, 0.7) and variants Dec 6, 2018
@bep bep closed this as completed in 4b5f743 Dec 7, 2018
@onedrawingperday
Copy link
Contributor Author

@bep Thank you for commit 4b5f743 👍

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants