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

Use javascript functions to parse CSSStyle values and remove regex #115

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

DH1994
Copy link

@DH1994 DH1994 commented Dec 13, 2023

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.

@danzen
Copy link
Contributor

danzen commented Dec 16, 2023

Hi Dennis - thanks for the work on this. A couple questions:

  1. Could you not have tested for this type of input and converted then passed the value in to the original code?

  2. 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

@DH1994
Copy link
Author

DH1994 commented Dec 18, 2023

Hi Dennis - thanks for the work on this. A couple questions:

  1. Could you not have tested for this type of input and converted then passed the value in to the original code?
  2. 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,

  1. Yes, I added a example with moves in the examples dir to test values without unit (opacity) now.

  2. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants