Skip to content

not all @keyframes included in generated output #17332

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

Closed
stefanprobst opened this issue Mar 21, 2025 · 1 comment · Fixed by #17352
Closed

not all @keyframes included in generated output #17332

stefanprobst opened this issue Mar 21, 2025 · 1 comment · Fixed by #17352

Comments

@stefanprobst
Copy link

What version of Tailwind CSS are you using?

4.0.15

What build tool (or framework if it abstracts the build tool) are you using?

nextjs

What version of Node.js are you using?

22

What browser are you using?

firefox

What operating system are you using?

linux

Reproduction URL

https://play.tailwindcss.com/dHTQWVQ1kz?file=css

Describe your issue

i am defining an animation in a @theme block which references two @keyframes by name. depending on the order, only one or both keyframes are included in the generated css:

@import "tailwindcss";

@theme {
  /* This adds only the "spin" keyframes to the generated css. */
  --animate-test: 1000ms ease-out 500ms both fade-in, 1000ms linear 500ms spin infinite;

  /* This adds both "spin" and "fade-in" keyframes to the generated css - the only difference is the order in which the two animations are listed. */
  /* --animate-test: 1000ms linear 500ms spin infinite, 1000ms ease-out 500ms both fade-in; */

  @keyframes fade-in {
    from { opacity: 0% }
    to { opacity: 100% }
  }
}

(see the playground link above)

philipp-spiess added a commit that referenced this issue Mar 24, 2025
Fixes #17332

This PR ensures that keyframes are emitted even when they are referenced
following a comma, e.g.:

```css
@theme {
  --animate-test: 500ms both fade-in, 1000ms linear 500ms spin infinite;
                                 /* ^ */

  @Keyframes fade-in {
    from {
      opacity: 0%;
    }
    to {
      opacity: 100%;
    }
  }
}
```

## Test plan

Added a unit test to capture the issue from #17332
@philipp-spiess
Copy link
Member

Thank you for the repro! I pushed a fix onto the main branch. We plan to release this with the next patch version of Tailwind CSS soon. 👍

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 a pull request may close this issue.

2 participants