yui / yuicompressor

YUI Compressor
http://yui.github.com/yuicompressor/
Other
3.01k stars 663 forks source link

CSS units being stripped from variables #322

Open solomax opened 5 years ago

solomax commented 5 years ago

CSS variables like --lbl-height: 0px;

are being transformed to --lbl-height:0; which break further calculations

Would appreciate any workaround for this (already tried to add space characters, to use 0.0px, no luck :((( )

looks related to #232 and #108

solomax commented 5 years ago

0ch seems to be workaround maybe it worth to add some flag to disable unit stripping?

Chris2011 commented 5 years ago

For 0 there shouldn't be a problem in CSS, because 0 is 0, doesn't matter em or px or whatever. But yes if you want to use 1.0em it will be stripped as mentioned in the other tickets.

solomax commented 5 years ago

@Chris2011 unfortunately you are wrong :( Here is the fiddle https://jsfiddle.net/solomax666/0m6wavyp/ demonstrating 0 is NOT 0 :(((

As you can see red box height is not equals to other boxes ....