codepunkt / css-spring

Generate physics based css-keyframe animations for the css-in-js solution of your choice or plain css.
MIT License
313 stars 15 forks source link

add support for parenthesized values #36

Open sunnyzanchi opened 2 years ago

sunnyzanchi commented 2 years ago

this change addresses #13. it lets spring generate keyframes for parenthesized values. it's a naive implementation — it doesn't care if there's a trailing parenthesis and can't handle multiple comma separated values, like transform: translate(30px, 30px). it also isn't smart enough to generate keyframes for start and end values like transform: scale(4) and transform: none. but it will work for multiple values, so transform: translateX(30px) translateY(30px) will work

i updated the tests with a couple new test cases and updated the snapshots to include keyframes with a transform