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

Minifier outputs invalid Hex codes for rgba and transparent values #238

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

Comments

Projects
None yet
2 participants
@bep

bep commented Dec 6, 2018

This a re-opening of #5506

This issue came up in the Hugo Forum a few days ago and today I also came across this behavior myself:

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

ref: https://discourse.gohugo.io/t/bug-minify-outputs-invalid-hex-codes-for-rgba-and-transparent-values/15609

I am opening this issue because this is something that looks like a proper bug but please note that currently my time is very limited and I cannot investigate further myself.

To add my own words:

The default minifier should produce correct result.

@tdewolff

This comment has been minimized.

Owner

tdewolff commented Dec 6, 2018

The results are correct, as per https://www.w3.org/TR/css-color-4/#hex-notation, it just seems that Edge https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#Browser_compatibility has not yet implemented it. I might have been a little early in adopting this new syntax.

@tdewolff

This comment has been minimized.

Owner

tdewolff commented Dec 6, 2018

I suggest you turn on the KeepCSS2 flag for now, I need to decide whether we keep the new color module in or leave it out.

@bep

This comment has been minimized.

bep commented Dec 7, 2018

The results are correct

From a minifier's standpoint, the results are not correct. I would expect a minifier, in its default settings, to work on the conservative side.

I suggest you turn on the KeepCSS2

I will, but please consider my comment above.

@tdewolff tdewolff closed this in eb69b4b Dec 9, 2018

@tdewolff

This comment has been minimized.

Owner

tdewolff commented Dec 9, 2018

It has indeed appeared that adding support for the Color Module Level 4 was too soon. After reviewing the draft's status (at https://www.w3.org/Style/CSS/current-work), it is clear that it is still in the exploring phase and cannot be expected to have been implemented by all clients. In particular, Edge does not support the #RRGGBBAA notation yet. Existing such notations will be minified using the draft specification though.

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