question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

We need to get keyframes to work, maybe something like this?

styled.div`
@keyframes {
  0% { color: transparent; }
  100% { color: awesome; }
}
`;

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

128reactions
geelencommented, Sep 13, 2016

Hmm. How about:

import styled, { keyframes } from "styled-components"

const animationName = keyframes`
  0% { color: transparent; }
  100% { color: radboats; }
`

const Div = styled.div`
  animation: ${animationName} 0.3s 0s both;
`
56reactions
haikyuucommented, Dec 1, 2016

Bonus point, you can use

function rotationBuilder(degree) {
  const rotation = keyframes`
    0% {
      transform: rotate(0deg);
    }
    25% {
      transform: rotate(-${degree}deg);
    }
    50% {
      transform: rotate(0deg);
      opacity: .9
    }
    75% {
      transform: rotate(${degree}deg);
    }
  `;
  return rotation;
}
const StyledDiv = styled.div`
  animation: ${rotationBuilder(10)} 1s linear infinite;
`

Which is totally awesome.

Read more comments on GitHub >

github_iconTop Results From Across the Web

keyframes - CSS: Cascading Style Sheets - MDN Web Docs
The @keyframes CSS at-rule controls the intermediate steps in a CSS animation sequence by defining styles for keyframes (or waypoints) along ...
Read more >
CSS @keyframes Rule - W3Schools
The @keyframes rule specifies the animation code. The animation is created by gradually changing from one set of CSS styles to another.
Read more >
Key frame - Wikipedia
In animation and filmmaking, a key frame (or keyframe) is a drawing or shot that defines the starting and ending points of a...
Read more >
Keyframes.app
Keyframes.app runs off your device's local storage - meaning everything you do here is only stored on your device. ... This site does...
Read more >
Keyframing animation | What is keyframing - Adobe
1. Select the layer you want to animate and click to reveal the Transform parameters for that layer. 2. Choose your parameter or...
Read more >

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found