Custom animations are not working when the prefix option is used
What version of Tailwind CSS are you using?
v2.2.15
What browser are you using?
Chrome
What operating system are you using?
macOS
Reproduction URL
https://play.tailwindcss.com/lQHpW5ODct
Describe your issue
Custom animations are not working when tailwind is used with prefix option.
Steps to reproduce:
- Open reproduction URL
- replace
tw-animate-shakeclass withanimate-shakein HTML section - remove
prefix: 'tw'in Config Section
It will work as expected without prefix.
Steps are including . is not working. If I replace: '6.5%' with '10%'. That step is working fine.
Reproduction URL: https://play.tailwindcss.com/QxyE7NfLCA
So this is the same issue with https://github.com/tailwindlabs/tailwindcss/issues/2425 but this is happening when I use prefix option
Yep @fatihsolhan, when you set the prefix, the prefix will also be inserted into the animation frames, ended with 6.5% => 6.tw-5\% and that will break your custom animation.
A quick workaround might be, remove the fractional parts.
Thanks for the report! I just checked and the reproduction appears to work as expected in Tailwind CSS v3.0+
Well with prefix like tw- it does seem to work but with a prefix like < it doesn't.
the prefix moves to the actual animation name so the css generated is
.\<animate-pulse {
animation: <pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
but the animation name is still pulse
I guess < and other characters are a bad prefix for tailwind, maybe put that in the doc somewhere?
see repro https://play.tailwindcss.com/F2twtDAK0K