-
Notifications
You must be signed in to change notification settings - Fork 952
Use javascript functions to parse CSSStyle values and remove regex #115
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
Conversation
danzen
commented
Dec 16, 2023
Hi Dennis - thanks for the work on this. A couple questions:
-
Could you not have tested for this type of input and converted then passed the value in to the original code?
-
I do not do much animation of CSS - can you link to a few tests that you did as a starting point so I can check it over more easily. Thanks.
Dan
Hi Dennis - thanks for the work on this. A couple questions:
- Could you not have tested for this type of input and converted then passed the value in to the original code?
- I do not do much animation of CSS - can you link to a few tests that you did as a starting point so I can check it over more easily. Thanks.
Dan
Hi Dan,
-
Yes, I added a example with moves in the examples dir to test values without unit (opacity) now.
-
In the example a square is moving from left to right. With the original code, the square only moves back and forth the first time. After the first position changes it didn't move anymore, because the value couldn't be parsed anymore. This is fixed.
612f55c to
dc99202
Compare
Added this to prevent failures when values have an exponent. For example: 3.4324e-8 will not be parsed with the current CSSPlugin. To prevent failures for transforms, I've rewritten the parseTransform and writeTransform functions to use CSSStyleValue.parse.