tailwindlabs / discuss

A place to ask questions, get help, or share what you've built with Tailwind CSS.
MIT License
171 stars 9 forks source link

Fade-in animation with 1.2 transitions #445

Open bennettdams opened 4 years ago

bennettdams commented 4 years ago

Is there a way to natively create fade in animations with the new 1.2 utilities? This is what I'm doing right now in Tailwind's index.css:


@tailwind base;

@tailwind components;

@tailwind utilities;

...

.fade-in {
  animation: animation-fade-in 1s;
}

.fade-in-fast {
  animation: animation-fade-in 0.3s;
}

.fade-in-slow {
  animation: animation-fade-in 1.5s;
}

@keyframes animation-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes animation-fade-in-fast {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes animation-fade-in-slow {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}