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

Scoped styles break @keyframes with percentages #145

Closed
Gyanreyer opened this issue Mar 26, 2023 · 3 comments
Closed

Scoped styles break @keyframes with percentages #145

Gyanreyer opened this issue Mar 26, 2023 · 3 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Gyanreyer
Copy link
Contributor

It looks like the scoped prefix class is getting applied to each keyframe percent, which ends up breaking the animation so that it doesn't work. Oddly, I don't think I've observed this issue when using from or to.

Example:
This:

<style webc:scoped>
  @keyframes my-anim {
    0% { opacity: 0; }
    100% {  opacity: 1; }
  }
</style>

Results in:

<style>
  @keyframes my-anim {
    .prefix-class 0% { opacity: 0; }
    .prefix-class 100% { opacity: 1; }
  }
</style>
@zachleat zachleat added the bug Something isn't working label Mar 28, 2023
@zachleat zachleat added this to the Next minor release milestone Mar 30, 2023
@zachleat zachleat self-assigned this Mar 30, 2023
@zachleat
Copy link
Member

Successfully reproduced.

@zachleat
Copy link
Member

Related upstream csstree/csstree#178

@zachleat
Copy link
Member

Shipping with the next release, thank you!

@zachleat zachleat changed the title Scoped styles break @keyframes Scoped styles break @keyframes with percentages Mar 31, 2023
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

No branches or pull requests

2 participants