Closed HeyHugo closed 7 years ago
weird :D
Good catch @HeyHugo we should fix it!
Stylis does prefix keyframes and animations but there is an option to disable this @rauchg, I think a lot of these issue will be solved with updating the fork up stream.
In this case it's a bug with prefixing duration
though, right?
Btw @thysultan would love to merge with upstream, but keep in mind we made the following changes:
:global
to skip prefixing. I saw you support :host
etc now, but since we can't really emulate web components 100%, I thought it was better not to fake it@rauchg Yes upstream handles 2 ':global' and attribute selectors. I could send a PR that that updates it upstream with 1. And ':host' disabled?
@thysultan that would be wonderful. Thanks for your awesome work on stylis
Pushed a few patches for animations until we have @thysultan's permanent solution. 🕺
Nice, now my first example works. However I think the shorthand version for animation is still broken.
e.g.
animation: 0.6s infinite slidein;
Produced css:
span[data-jsx="3080172011"] {-webkit-animation:a30801720110.6s infinite slidein;-moz-animation:a30801720110.6s infinite slidein;animation:a30801720110.6s infinite slidein;}@-webkit-keyframes a3080172011slidein {from {margin-left: 100%;width: 300%;}to {margin-left: 0%;width: 100%;}}@-moz-keyframes a3080172011slidein {from {margin-left: 100%;width: 300%;}to {margin-left: 0%;width: 100%;}}@keyframes a3080172011slidein {from {margin-left: 100%;width: 300%;}to {margin-left: 0%;width: 100%;}}
@HeyHugo once https://github.com/zeit/styled-jsx/pull/73 is merged it should handle all cases, previously it was making the assumption that the animation name will always come first, but really it can be anywhere in the declaration.
That's remarkably helpful @thysultan, thank you so much!
@giuseppeg @thysultan , I'm getting conflict in animation keyframe when i use only point based value in animation timing shorthands. Like .8s instead of 0.8s for example. The former syntax is accepted in the browser afaik. Not so important, just came across this.
Input:
animation: moveR .8s 1s linear;
@keyframes moveR {
...
}
Output:
-webkit-animation: a1838729535moveR a1838729535.8s 1s linear;
-moz-animation: a1838729535moveR a1838729535.8s 1s linear;
animation: a1838729535moveR a1838729535.8s 1s linear;
@-webkit-keyframes a1838729535moveR {
...
}
@-moz-keyframes a1838729535moveR {
...
}
@keyframes a1838729535moveR {
...
}
@aga5tya Can't reproduce in stylis, what version of styled-jsx are you using?
Hi!
I was trying to do a keyframe animation with styled-jsx, but the produced css looks a bit strange and my animation doesn't work.
This is what I try to render:
and this is the produced css:
As you can see the data-jsx number (1065293759) seem to be prefixed before all animation property values.
Am I doing this wrong or could this be a real issue?