Use index with tailwind's dynamic class in a for-loop to manage animation-delay? #11918
Answered
by
LinusBorg
rowild
asked this question in
Help/Questions
-
In a Nuxt project that uses tailwindcss I would like to animate a drop-down list. To do so I would like to use the <div v-for="(item, index) in items" :key="index">
<div class="transition" :class="{ 'visible bg-opacity-100 delay-[100ms * ${index}]': showItems }">...</div>
</div> This does not work though. Would anybody happen to know what the proper way of writing such CSS is? |
Beta Was this translation helpful? Give feedback.
Answered by
LinusBorg
Sep 13, 2024
Replies: 1 comment 4 replies
-
<div v-for="(item, index) in items" :key="index">
<div class="transition" :class="{ [`visible bg-opacity-100 delay-[${100 * index}ms]`]: showItems }">...</div>
</div> |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You added single quotes around the dynamic property that don't belong there