Giter Site home page Giter Site logo

Comments (5)

jeremyckahn avatar jeremyckahn commented on July 20, 2024

Thanks for the issue report @jabbrass, and I'm glad you like Stylie! The second, percentage-based translate is intentional. it is necessary for centering content with only transforms. The CSS spec allows for multiple translates in a transform rule, and Rekapi (the engine that generates the CSS animation code) adds it when the "Center to path" option is enabled in the "Motion" tab. In Stylie's case, the first rule specifies which XY coordinates to place a given keyframe, and the second one centers the element. In my testing, this seems to work consistently in both Firefox and Chrome: http://codepen.io/jeremyckahn/pen/KCheJ

If you deselect "Center to path," the centering translate rule will be removed from the generated CSS.

I have adapted your provided CSS for both WebKit and Firefox and do not see a discrepancy: http://codepen.io/jeremyckahn/pen/tAaJH

It sounds like you found a scenario that exposes a potential bug for Firefox. Can you provide an example animation with both the CSS and HTML that exposes the bug? I suspect that there may be other styles related to the layout of the animating element that may be at play.

from stylie.

machineloop avatar machineloop commented on July 20, 2024

Thanks for the quick response. I didn't know there was a 'Center to path' option that could be turned off.

Sorry, I neglected to mention any details about what I'm using the animations on. I'm using them to animate paths inside of an SVG. I believe you're right, there must be a bug in the CSS implementation in FF use of SVGs. I've run across other bugs while experimenting, so its not entirely surprising.

I believe that everything works great for regular DOM elements, I tested it both inside and outside the SVG, and only the SVG seems to be a problem on Firefox (32.0.2). Obviously SVG CSS animations are a bit experimental at his point.

Codepens showing difference:
Broken in FF: http://codepen.io/anon/pen/kJmuf
Consisent across Chrome and FF: http://codepen.io/anon/pen/rkFqd

from stylie.

jeremyckahn avatar jeremyckahn commented on July 20, 2024

Thanks for the samples. Both links actually work inconsistently for me in Firefox and Chrome — can you please check the second CodePen link again?

As far as SVG animation and CSS, my knowledge is fairly limited. If there is a general, non-invasive rule that can be applied to Rekapi/Stylie's generated CSS to make SVG animations work more consistently across more browsers, I would be happy to add it by default. In your experimentation, have you found a rule that will achieve this?

from stylie.

machineloop avatar machineloop commented on July 20, 2024

Yes, sorry, I pasted the wrong link in the second example, I just modified it above to: http://codepen.io/anon/pen/rkFqd
The first link has different initial animation positioning, the second, one corrected here, should be positioned the same in both browsers without the second translate.

I don't know of any general, non-invasive rule; I suspect that you're correct in your assessment that there's a FF bug at work here. I'm ready to close this as a non-issue with your work. 👍

Thanks again for building a fantastic tool! I've really enjoyed working with it. And thanks for your quick response and willingness to help. I may post something over at Bugzilla about this. We'll see, maybe it's just my local machine...

I see you've been working on this for a few years now. Do you have a Gittip account?

from stylie.

jeremyckahn avatar jeremyckahn commented on July 20, 2024

Ah yes, I see the discrepancy now. Thanks for posting a link showing the "no centering" workaround.

For the moment I am going to chalk this up as an edge-case, Firefox-specific bug and close this issue. If you find a rule that can be added to the CSS output, please reopen this issue and we can revisit it to prevent others from having this problem. I'm happy to hear you're finding Stylie useful!

from stylie.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.