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

motion-width-* and motion-height-* classes #22

Open
rootEnginear opened this issue Dec 14, 2024 · 0 comments
Open

motion-width-* and motion-height-* classes #22

rootEnginear opened this issue Dec 14, 2024 · 0 comments

Comments

@rootEnginear
Copy link

Feature Suggestion:

It would be great to introduce motion-width-* and motion-height-* classes for animating an element's width and height rather than its scaleX and scaleY.

In the implementation example below, I have also attached will-change property with the keyframes to help with the performance.

{
  "@keyframes motion-width-in": {
    "0%": {
      "width": "var(--motion-origin-width)",
      "willChange": "width"
    },
    "100%": {
      "width": "100%",
      "willChange": "auto"
    },
  },
  "@keyframes motion-width-out": {
    "0%": {
      "width": "100%",
      "willChange": "width"
    },
    "100%": {
      "width": "var(--motion-end-width)",
      "willChange": "auto"
    }
  }
}

I'd love to hear any additional thoughts or considerations on this proposal.

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

No branches or pull requests

1 participant