How to Export Sketch to CSS Animations Code

Or how to communicate animations without waving your hands

Anima App
Anima App
Jun 14, 2018 · 3 min read

Anima allows designers to create high-fidelity prototypes right inside Sketch, Adobe XD, and Figma and export HTML & CSS in a single click.

Image for post
Image for post

Our mission is to bridge the gap between designers and developers.

Enormous amount of time and effort during product development is being spent on designers communicating to developers how the product should look and feel. Usually things get lost in translation.

If you’re a perfectionist who cares about the details, that can be pretty frustrating.

One of the things that can create a great user experience are animation that are woven into our design.

But until now we were limited in the ways we can hand off animations to developers. Common practices are creating GIFs or waving our hands to explain how an animation should look.

Image for post
Image for post

As developers, it’s time-consuming to try to reverse engineer an animation by looking at a GIF. It’s even harder to reverse engineer designers waving their hands trying to explain a custom ease-in-out timing function.

That’s why today we are starting our beta for a new feature of Timeline called Export Code.

Image for post
Image for post

With Export Code, we can export our animations to actual code. This way, developers can simply inspect the keyframes, easing functions and other values that make up the animation.

The new Export Code feature is available in our latest plugin version. To try it out, update your Anima Toolkit plugin:

Image for post
Image for post
  1. Click the rightmost tab of our plugin to reveal Timeline.
  2. Click “Tutorial”.
  3. Expand “Practice 2” and select “Cup
  4. In our plugin panel, click “Animate Selection
  5. In “Keyframe1” drag the coffee content upwards
  6. This will create an animation timeline (blue band), extend its duration
  7. Play with the Cubic Bezier easing function graph
  8. Click “Export Code”
Image for post
Image for post
Image for post
Image for post

Clicking “Export Code” will generate a handoff link.

This link can be shared with developers, where they can use delightful tools like JSFiddle or CodePen to inspect and play the animation. Developers can also download the plain text HTML file that includes the CSS and Javascript inside it.

All the keyframes and easing functions values that construct the animation are easily readable through the HTML/CSS/JS code.

Image for post
Image for post

As always, we’re excited to hear your feedback!

Join the discussion or show off your designs on Facebook, Twitter, Slack, Instagram, and vote for new features at UserVoice.

Stay creative!
❤️ Anima team

Design + Sketch

The best collection of articles, tips, tutorials, and…

Anima App

Written by

Anima App

Design to development platform

Design + Sketch

The best collection of articles, tips, tutorials, and stories on designing and prototyping with Sketch and beyond

Anima App

Written by

Anima App

Design to development platform

Design + Sketch

The best collection of articles, tips, tutorials, and stories on designing and prototyping with Sketch and beyond

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store