csslint
csslint copied to clipboard
Zero values sometimes need units
In the wiki (https://github.com/CSSLint/csslint/wiki/Disallow-units-for-zero-values) it states that "The value of 0 works without specifying units in all situations where numbers with length units or percentages are allowed."
However, I was able to create a minimal working example which demonstrates that omitting the percentage when the value is 0 can affect how the content is displayed. This happens across browsers: https://codepen.io/judowalker/pen/xrMxWj
If the containing block's width depends on this element's width, then the resulting layout is undefined in CSS 2.1.
—http://www.w3.org/TR/CSS21/visudet.html#the-width-property
not all zero
do not need units, some like duration
, Resolution
etc need. such as transition-delay