madebysource / lesshat

Smart LESS CSS mixins library.
lesshat.com
MIT License
2.19k stars 259 forks source link

workaround for semicolon and safari 9's parseerror #166

Closed oroce closed 8 years ago

oroce commented 8 years ago

This intended to be a fix for #164, rather a messy workaround until this gets fixed.

What we do is tranforming this:

lesshat-selector {
    -lh-property: 0;
}
@-webkit-keyframes fadein {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
@-moz-keyframes fadein {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
@-o-keyframes fadein {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
@keyframes fadein {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

into this:

lesshat-selector {
    -lh-property: 0;
}
@-webkit-keyframes fadein {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
@-moz-keyframes fadein {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
@-o-keyframes fadein {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
@keyframes fadein {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
[not-existing] {
    zoom: 1;
}

It is need since ;} gets appended to the value which is returned by the keyframe function, so we are adding a (probably) nonmatching selector and the least harmful css property. :((((

YouriT commented 8 years ago

Great @oroce works fine for me thanks :)

listepo commented 8 years ago

+1

oroce commented 8 years ago

in case someone wants to use this with less-plugin-npm-import just install npm install purposeindustries/lesshat#fix-keyframe-safari9

rahul-sekhar commented 8 years ago

+1

petrbrzek commented 8 years ago

@oroce Thanks for the PR.

yoannmoinet commented 8 years ago

Hi @petrbrzek! Has this been merged/built yet? I can't found out how to get this fix from your repo.

mboudreau commented 8 years ago

@yoannmoinet there hasn't been a release of lesshat in 2 years...

petrbrzek commented 8 years ago

@yoannmoinet Sorry guys, wrong button.

mcfedr commented 8 years ago

what are the chances of 3.0.3?

mboudreau commented 8 years ago

High enough. I think I may have time tonight to work on it.

On Thu, Jun 9, 2016 at 4:38 PM Fred Cox notifications@github.com wrote:

what are the chances of 3.0.3?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/madebysource/lesshat/pull/166#issuecomment-224812183, or mute the thread https://github.com/notifications/unsubscribe/AAjA5LcX_ajydqznoYMy7Z4P_KY8PkFnks5qJ7TQgaJpZM4GS85v .

mboudreau commented 8 years ago

@mcfedr version 3.0.3 released, go ahead and update your npm dependencies and see how it goes.

Cheers.

mboudreau commented 8 years ago

@mcfedr Disregard 3.0.3, the build didn't package properly. I was trying out a better way to deploy, which I think is fixed now. Because of the major risk involved with deploying something that hasn't been done in so long, I've updated the build number to 4.0.X. I finally got 4.0.1 working and out, however, it doesn't have the 'build' folder anymore; instead I'm just package the built less files only.

Please try it out and let me know how it goes. Cheers.

mcfedr commented 8 years ago

Looking good! Thanks