Skip to content

How to give custom animation-duration in tailwind #9096

Answered by wongjn
abhi40308 asked this question in Help
Discussion options

You must be logged in to vote

You can keep your original class name with the arbitrary values and simply remove the extended animationDuration and animationDelay configurations – the values used in the arbitrary class name are already contained because they are in the class name:

<div className="animate-[fadeIn_300ms_ease-out_900ms_forwards]" />

Results in:

.animate-\[fadeIn_300ms_ease-out_900ms_forwards\] {
  animation: fadeIn 300ms ease-out 900ms forwards;
}

Proof with this Tailwind Play with a blank config.

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@abhi40308
Comment options

Answer selected by abhi40308
Comment options

You must be logged in to vote
1 reply
@Medayoubadri
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
5 participants