NUglify icon indicating copy to clipboard operation
NUglify copied to clipboard

Missing CSS optimization - 0% (and other units)

Open SpeednetGroup opened this issue 2 years ago • 2 comments

Please update the CSS optimizations in NUglify to remove the percent sign from zero (0) percentages.

Instead of 0% for a value, it should be 0.

This would apply to other units of measure as well. For exmaple, px, em, pt, in, cm, mm, pc, ex, %, ms, s, deg, rad, grad.

SpeednetGroup avatar Apr 16 '22 01:04 SpeednetGroup

I'm a bit out of practice with CSS but I'm pretty sure that % was necessary under some circumstances, but maybe I'm just thinking back to some awful IE6 days?

trullock avatar Apr 16 '22 18:04 trullock

I'm a bit out of practice with CSS but I'm pretty sure that % was necessary under some circumstances, but maybe I'm just thinking back to some awful IE6 days?

You're right, there is a case and I just tested it. You cannot specify an RGB or HSL color using percentages together with a zero that's missing the percentage sign. But this does not apply in most other cases. For example, you can specify margin:10% 0.

SpeednetGroup avatar Apr 17 '22 00:04 SpeednetGroup