Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVG properties do not animate when target value is a CSS Custom Property #1334

Closed
tinleym opened this issue Nov 4, 2021 · 0 comments · Fixed by #1366
Closed

SVG properties do not animate when target value is a CSS Custom Property #1334

tinleym opened this issue Nov 4, 2021 · 0 comments · Fixed by #1366
Labels
bug Something isn't working

Comments

@tinleym
Copy link

tinleym commented Nov 4, 2021

1. Describe the bug
SVG properties do not animate when target is a CSS Custom Property; animation seems to work fine when the value is hardcoded.

2. IMPORTANT: Provide a CodeSandbox reproduction of the bug
In the example below, hardcoded values work on SVGs where variables do not...
https://codesandbox.io/s/keen-resonance-5rovv?file=/src/App.js

3. Steps to reproduce
Steps to reproduce the behavior:

  1. Hover the text -- the animation sets color to a CSS Custom Property: ok
  2. Hover the smile -- the animation sets the wrapper color to a CSS Custom Property (the target's stroke is currentColor): ok
  3. Hover the paperclip -- the animation sets stroke to a CSS Custom Property: does not work
  4. Hover the shield -- the animation sets stroke to a hardcoded value: ok
  5. Hover the eye -- the animation sets stroke-width the a CSS Custom Property: does not work
  6. Hover the wrench -- the animation sets stroke-width to a hardcoded value: ok

4. Expected behavior
The SVG properties should animate to CSS Custom Properties like they do for a hardcoded values.

5. Environment details
framer-motion 5.2.0 / Chrome 95.0.4638.69 / MacOs 11.4

@tinleym tinleym added the bug Something isn't working label Nov 4, 2021
@tinleym tinleym closed this as completed Nov 4, 2021
@tinleym tinleym reopened this Nov 4, 2021
@tinleym tinleym changed the title SVG stroke doesn't animate when target is a CSS Custom Property SVG properties animate when target is a CSS Custom Property Nov 4, 2021
@tinleym tinleym changed the title SVG properties animate when target is a CSS Custom Property SVG properties do not animate when target is a CSS Custom Property Nov 4, 2021
@tinleym tinleym changed the title SVG properties do not animate when target is a CSS Custom Property SVG properties do not animate when target value is a CSS Custom Property Nov 4, 2021
@mergetron mergetron bot closed this as completed in #1366 Nov 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant