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.

Box-shadows only render once the animation completes

See original GitHub issue

To reproduce:

  • Go to demo page.
  • Using developer tools, go to the .demo-content element and add this box shadow style:
box-shadow: 0 6px 7px -4px rgba(0, 0, 0, 0.2), 0 11px 15px 1px rgba(0, 0, 0, 0.14), 0 4px 20px 3px rgba(0, 0, 0, 0.12);

Observe the box-shadow appearance at the end of the animation:

boxshadow5

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Stankocommented, May 30, 2017

CSS classes are added here. Docs are updated with a new prop.

I hope this is what you were going for (rather large gif):

shadow-2

Please note that box shadow transition should be passed through style object not to be overridden in the react component.

CSS

.demo-1.rah-static--height-specific,
.demo-1.rah-static--height-auto,
.demo-1.rah-animating--to-height-specific,
.demo-1.rah-animating--to-height-auto {
  box-shadow: 5px 5px 20px rgba(0,0,0,0.3);
}

JS

<AnimateHeight
  duration={ 1000 }
  height={ height }
  className='demo demo-1'
  style={ { transition: 'box-shadow 1000ms' } }
>

When you check it yourself, please close the issue.

Cheers!

~P.S. I will publish it to NPM in a few minutes.~ Done.

0reactions
Stankocommented, Jun 1, 2017

I guess hooray emoji means this is fixed 😃 closing it!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to animate box-shadow with silky smooth performance
Short answer: you don't. Animating a change of box-shadow will hurt performance. There's an easy way of mimicking the same effect, however, ...
Read more >
Applying box shadows in React Native - LogRocket Blog
Applying box shadows in a React Native app is not always straightforward. Learn to apply box shadows across the iOS and Android platforms....
Read more >
Using CSS animations - CSS: Cascading Style Sheets | MDN
Specifies the length of time in which an animation completes one cycle. ... In this third example, three animations are specified, but only...
Read more >
How to Animate CSS Box Shadows and Optimize Performance
Once the tools are open, head over to the Performance tab. You can record the shadow animation; just a few seconds is enough...
Read more >
Motion components | Framer for Developers
Motion components are DOM primitives optimised for 60fps animation and gestures. There's a motion component for every HTML and SVG element, for instance ......
Read more >

github_iconTop Related Medium Post

No results found

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