Skip to content
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

0 requires a unit when declaring <time> #224

Closed
philipwalton opened this issue Jan 19, 2012 · 4 comments
Closed

0 requires a unit when declaring <time> #224

philipwalton opened this issue Jan 19, 2012 · 4 comments
Labels
Milestone

Comments

@philipwalton
Copy link
Contributor

CSSLint reports that 0s should just be 0, which in incorrect.

According to these sites, time values must have a unit.
http://www.w3.org/TR/css3-values/#time
https://developer.mozilla.org/en/CSS/time

@nzakas
Copy link
Contributor

nzakas commented Jan 25, 2012

I'm not sure that's correct. The spec doesn't specifically say omitting the unit is incorrect, and Mozilla's reference page has contradictory information. Even though it shows 0 as invalid in the examples, it also says:

As all units represents the same time for the value 0, the unit may be omitted in that case: 0 represents 0s, 0ms.

@philipwalton
Copy link
Contributor Author

You're right that the Mozilla site contradicts itself; however, when you implement a CSS transition in Firefox using 0 instead of 0s, the transition doesn't happen at all.

Here's an example:
http://jsfiddle.net/J8NsQ/

Perhaps this should be viewed as a bug in Firefox, but either way, it seems like the CSSLint rules should only test length values until the spec is finalized and this issue is less ambiguous. I'd be happy to submit a pull request if you'd like.

@michalbe
Copy link

I wrote a blog post about this and create a bug report about a year ago. The answer was that you can skip the units ONLY when it refers to 'pixels'

@stubbornella
Copy link
Member

Wow, this is odd. We need to fix the rule for now. In fact, validation should check that all time measures have a unit.

@nzakas nzakas closed this as completed in 95e5d18 Jan 31, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants