/tailwind-4:handling-animationsfrom tailwind-4
Define animations with @keyframes within @theme directive, use animate-{name} utilities, and implement entry animations with starting: variant. Use when creating custom animations or entry effects.
Ships in tailwind-4. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Define custom animations using @keyframes within the @theme directive and use Tailwind's animation utilities with full variant support.
Define animations within @theme:
@import 'tailwindcss';
@theme {
--animate-fade-in: fade-in 0.3s ease-out;
@keyframes fade-in {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
}
Usage:
<div class="animate-fade-in">Fades in on load</div>
Pattern: --animate-{name}: {animation-shorthand};
The variable name determines the utility class:
@theme {
--animate-spin: spin 1s linear infinite;
--animate-bounce: bounce 1s infinite;
--animate-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
Generates utilities:
animate-spinanimate-bounceanimate-pulseFade In:
@theme {
--animate-fade-in: fade-in 0.3s ease-out;
@keyframes fade-in {
0% { opacity: 0; }
100% { opacity: 1; }
}
}
Fade In with Scale:
@theme {
--animate-fade-in-scale: fade-in-scale 0.3s ease-out;
@keyframes fade-in-scale {
0% {
opacity: 0;
transform: scale(0.95);
}
100% {
opacity: 1;
transform: scale(1);
}
}
}
Slide Up:
@theme {
--animate-slide-up: slide-up 0.4s ease-out;
@keyframes slide-up {
0% {
opacity: 0;
transform: translateY(20px);
}
100% {
opacity: 1;
transform: translateY(0);
}
}
}
For complete directional slide examples (left, right, top, bottom), see Animation Library.
Spin:
@theme {
--animate-spin: spin 1s linear infinite;
@keyframes spin {
to { transform: rotate(360deg); }
}
}
Bounce:
@theme {
--animate-bounce: bounce 1s infinite;
@keyframes bounce {
0%, 100% {
transform: translateY(-25%);
animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
}
50% {
transform: translateY(0);
animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
}
}
}
For additional motion animations (pulse, ping, shake, wiggle), see Animation Library.
The starting: variant applies styles before animations begin:
<div class="opacity-100 transition-opacity duration-300 starting:opacity-0">
Fades in smoothly
</div>
<div class="
translate-y-0 opacity-100
transition-all duration-300
starting:translate-y-4 starting:opacity-0
">
Slides up while fading in
</div>
How it works:
starting: stylesAnimations work with all Tailwind variants:
<div class="hover:animate-spin">Spins on hover</div>
<div class="focus:animate-pulse">Pulses on focus</div>
<div class="group-hover:animate-bounce">Bounces when parent hovered</div>
<div class="lg:animate-fade-in">Animates on large screens</div>
<div class="dark:animate-pulse">Pulses in dark mode</div>
<div class="space-y-4">
<div class="animate-slide-up [animation-delay:0s]">Item 1</div>
<div class="animate-slide-up [animation-delay:0.1s]">Item 2</div>
<div class="animate-slide-up [animation-delay:0.2s]">Item 3</div>
<div class="animate-slide-up [animation-delay:0.3s]">Item 4</div>
</div>
Delayed Animation:
<div class="
animate-fade-in
[animation-delay:0.1s]
[animation-fill-mode:both]
">
Delayed fade in
</div>
Pause on Hover:
<div class="animate-spin hover:[animation-play-state:paused]">
Pauses on hover
</div>
fade-in not anim-1Respect user motion preferences:
@media (prefers-reduced-motion: reduce) {
* {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}
For comprehensive animation examples and patterns, see:
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub djankies/claude-configs --plugin tailwind-47 skills in this plugin
/configuring-tailwind-v4Configure Tailwind CSS v4 using Vite plugin, PostCSS, or CLI with CSS-first configuration via @import and @theme directives. Use when setting up new projects or migrating build tools./creating-custom-utilitiesCreate custom utilities with @utility directive supporting static utilities, functional utilities with values, theme-based utilities, and multi-value utilities. Use when extending Tailwind with custom CSS properties or patterns./migrating-from-v3Migrate from Tailwind CSS v3 to v4 including configuration migration (JS to CSS), utility renames, opacity changes, and color system updates. Use when upgrading existing projects to v4.Other plugins' skills for the same job