CSSLint / csslint

Automated linting of Cascading Stylesheets
http://csslint.net
Other
4.76k stars 483 forks source link

Zero values sometimes need units #702

Open judowalker opened 7 years ago

judowalker commented 7 years ago

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

infinnie commented 7 years ago

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

likezero commented 6 years ago

not all zero do not need units, some like duration, Resolution etc need. such as transition-delay