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

Wrong keyframe keys when generationg CSS classes with JS #7149

Closed
Mastercuber opened this issue Jan 20, 2022 · 1 comment · Fixed by #7163
Closed

Wrong keyframe keys when generationg CSS classes with JS #7149

Mastercuber opened this issue Jan 20, 2022 · 1 comment · Fixed by #7163
Assignees

Comments

@Mastercuber
Copy link

Mastercuber commented Jan 20, 2022

What version of Tailwind CSS are you using?

For example: v3.0.15

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

postcss-cli 9.1.0, vite 2.7.13

What version of Node.js are you using?

16.13.2

What browser are you using?

Firefox

What operating system are you using?

Ubuntu 20.04

Reproduction URL

https://github.com/Mastercuber/tailwindcss-minimal-example

Describe your issue

In the config file tailwind.config.js I'm generating some animations with floating point numbers in the class name like this.
The generated animation classes looks good, but the @keyframe directives have a different value than the animation classes itself, though the exact same key is used for both.

The used class in the App is animate-zoom-2.5 to actually see it in the output and the generated css is here

Now I just use another key for the keyframe name.

@vitorrd
Copy link
Contributor

vitorrd commented Jan 21, 2022

Hey, @Mastercuber. What you're seeing there isn't the "wrong key" per se. Tailwind is mistakenly trying to prefix the "." in your animation value and keyframe name when it should instead be escaping them and then prefixing.
I will send the Tailwind team a PR to address this.

@thecrypticace thecrypticace self-assigned this Feb 28, 2022
thecrypticace added a commit that referenced this issue Mar 1, 2022
* Add prefix alone to animation names. Fixes #7149.

* Add test for keyframe animations with a dot in the name

* Add test for prefixed version

* Fix CS

* Simplify

* Update changelog

* Fix

Co-authored-by: Jordan Pittman <[email protected]>
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.

3 participants