motiondivision / motiondivision/motion
[BUG] CSS variables for bg color + spring for other property causes bg color to misbehave
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 33.7k
- Forks
- 1.4k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 14
Description
When I use CSS variables for backgroundColor and a spring animation for an unrelated property - like scale - on the same motion element it causes the backgroundColor to jump back to a previous value near the animation's end.
https://codesandbox.io/s/eloquent-bose-nmqklf?file=/src/App.js
Steps to reproduce
Steps to reproduce the behavior:
- Use CSS variables for the backgroundColor property
- Use a spring type animation on any other property
Expected behavior
The button animates the same way with CSS variables and a spring animation as it would without them.
Video
Environment details
Tested on Chromium (114.0.5735.198) and Firefox (118.0.1)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked CodeSandbox and its src/App.js reproduction. Verify the backgroundColor CSS variable together with a spring animation on another property, then compare the result with the non-variable case; done means the background color no longer jumps back near the animation’s end.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100