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

Minifying '0s' to '0' in Firefox in transition-delay #226

Closed
elidare opened this issue Mar 20, 2015 · 7 comments
Closed

Minifying '0s' to '0' in Firefox in transition-delay #226

elidare opened this issue Mar 20, 2015 · 7 comments
Labels

Comments

@elidare
Copy link

elidare commented Mar 20, 2015

Follow-up for #82 and #100.

-moz-transtion-delay: 0s;
transition-delay: 0s;

shouldn't be minified, as for transition-duration, too.

@Djules
Copy link

Djules commented Apr 25, 2015

+1 for transition-duration on Chrome, it doesn't like the value without its unit.

@YStrauch
Copy link

YStrauch commented May 8, 2015

Same goes for mixed statements in Chrome:

-webkit-transition: visibility 0s linear 1s;

shouldn't be minified to 0 as well

@dahart
Copy link

dahart commented May 18, 2015

I bumped into this with the 'animation' property on Chrome.

Two observations -

  • With multiple prefixed versions of the tag, the last one survives, but the rest don't.
    Example, unminified:
    #id {
    -webkit-animation : rotate 10s linear 0s infinite;
    -ms-animation : rotate 10s linear 0s infinite;
    animation : rotate 10s linear 0s infinite;
    }
    And minified:
    #id{-webkit-animation:rotate 10s linear 0 infinite;-ms-animation:rotate 10s linear 0 infinite;animation:rotate 10s linear 0s infinite}
  • A workaround is to use 0.01s, or something sufficiently small enough.

@lsirivong
Copy link

I encountered this recently as well. The crux of this issue as that non-length dimensions are required to have units according to the spec:

A dimension is a number immediately followed by a unit identifier.

Lengths are explicitly allowed to omit the unit for zero values:

Lengths refer to distance measurements and are denoted by <length> in the property definitions. A length is a dimension. However, for zero lengths the unit identifier is optional (i.e. can be syntactically represented as the <number> ‘0’).

Here's a list of dimensions that are not <length>s, and always require units:

  • Angles
    • deg
    • grad
    • rad
    • turn
  • Times
    • s
    • ms
  • Frequencies
    • Hz
    • kHz
  • Resolutions
    • dpi
    • dpcm
    • dppx

Hope this helps!

@lahmatiy lahmatiy added the bug label Oct 7, 2015
lahmatiy added a commit that referenced this issue Oct 7, 2015
Don't strip units off dimensions of non-length (issues #226, #229)
@lahmatiy
Copy link
Member

lahmatiy commented Oct 8, 2015

Fixed in 1.3.12

@lahmatiy lahmatiy closed this as completed Oct 8, 2015
@amiga-500
Copy link

Curious...although this was fixed a while back i am wondering if modern browsers still have this issue of unitless zeros. From my tests it seems all the browsers now accept 0 without a unit. Love to get anyones thoughts.

@henrykuijpers
Copy link

@amiga-500 , unfortunately the newest Chrome (on today's date) does not. It still shows invalid property value:
image

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

8 participants