Skip to content

How to define a custom animation / keyframes with Twind? #1542

Answered by zaynetro
zaynetro asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks! I was reading their new https://twind.style/ website and couldn't find anything I could understand about animations. Luckily, the examples from the old website worked.

So fade in animation using twind v1 could be done like this

import { animation, keyframes } from "@twind/core";

const fadeIn = animation(
  "0.2s ease-in-out",
  keyframes({
    "0%": {
      opacity: 0,
    },
    "100%": {
      opacity: 1,
    },
  }),
);
<div class={`${fadeIn}`}>

Replies: 1 comment 1 reply

Comment options

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

Answer selected by zaynetro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants