stylus / nib

Stylus mixins, utilities, components, and gradient image generation
http://stylus.github.io/nib
MIT License
1.91k stars 249 forks source link

Vendor-keyframes get useless vendor-properties #229

Closed igl closed 8 years ago

igl commented 10 years ago

A simple animation:

@keyframes myAnim
    0%
        transform rotate(0)
    ...

...generates keyframes with tons of useless properties

@-moz-keyframes myAnim {
    0% {
        -webkit-transform: rotate(0);
        -moz-transform: rotate(0);
        -o-transform: rotate(0);
        -ms-transform: rotate(0);
        transform: rotate(0);
    }
    ...

@-moz-keyframes should only have -moz-transform as property. etc.

notslang commented 10 years ago

Good catch... I still need to reproduce this once I get back home, but that looks like something that will be an easy fix.

Calvein commented 10 years ago

The keyframes prefixes are actually set with Stylus directly (http://learnboost.github.io/stylus/docs/keyframes.html), but yes, that's a bummer, and it creates keyframes for -ms- and -o- which never need the prefixes (event if the doc show only -webkit- and -moz-) and -moz- is pretty useless now since it was supported only 10 version ago (http://caniuse.com/#search=css3%20animation).

tannerlinsley commented 9 years ago

We should get this fixed. This would greatly impact the output size for nzAnimate http://github.com/nozzle/nzAnimate. Is this a stylus bug or a nib bug?

igl commented 8 years ago

Here is a fix:

vendors = 'official'
@keyframes myAnim
    0%
        transform rotate(0)

This should stop stylus from creating vendor prefixes and leave it up to nib. See: http://stylus-lang.com/docs/keyframes.html#expansion

Maybe nib could include that fix? Could it hurt?

igl commented 8 years ago

I closed this with a workaround. Could this be done by nib? @slang800