Motion design system for Astro + Tailwind v4 + Svelte 5 — animation tokens, component state patterns, scroll reveals, performance rules, and modern CSS 2025/2026 features. Use this skill whenever adding any animation, transition, hover effect, scroll reveal, micro-interaction, or motion to any component or page. Also use when the user mentions "animation", "transition", "hover effect", "motion", "scroll reveal", "fade in", "entrance animation", "interactive feel", or wants a page to feel "more alive", "more polished", or "like Stripe/Apple/Linear/Vercel".
インストール
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
Motion design system for Astro + Tailwind v4 + Svelte 5 — animation tokens, component state patterns, scroll reveals, performance rules, and modern CSS 2025/2026 features. Use this skill whenever adding any animation, transition, hover effect, scroll reveal, micro-interaction, or motion to any component or page. Also use when the user mentions "animation", "transition", "hover effect", "motion", "scroll reveal", "fade in", "entrance animation", "interactive feel", or wants a page to feel "more alive", "more polished", or "like Stripe/Apple/Linear/Vercel".
Motion Design System
Animation is communication. Every motion in the UI must earn its place by answering: does this help the user understand what just happened, where focus is, or what they can do next? If the answer is no, remove it.
Core principles
Purpose over decoration — animation guides attention, confirms actions, and reveals hierarchy. It does not add sparkle for its own sake.
Orientation — motion should reinforce spatial relationships. Things that slide in from the right came from the right. Things that expand grew from a point. Misleading direction confuses.
Speed feels quality — slow animations feel cheap and in the way. Responsive interfaces feel fast because their transitions are fast.
Mobile first, touch always — hover effects are an enhancement, not a requirement. Test on touch.
Accessibility is not optional — prefers-reduced-motion: reduce must always be handled. Users with vestibular disorders and epilepsy rely on this. No exceptions.
Core Web Vitals — animations must never trigger layout (CLS), delay interactivity (INP), or block paint (LCP). Animate only composited properties.
Animation Design Tokens
Define once in the shared CSS entry (src/styles/app.css or equivalent). Every component imports these — no ad-hoc duration-[237ms] arbitrary values.
Add will-change: transform, opacityonly on elements that are known to animate imminently (e.g., a nav drawer that opens). Remove it after the animation with JavaScript. Applying it broadly wastes GPU memory and can slow the page down.
GPU acceleration
translateZ(0) or translate3d(0,0,0) forces GPU layer promotion. Use sparingly — only when you observe compositor jank on a real device.
Apple / Linear / Stripe motion rules
Study these sites before inventing something new. Their shared rules:
Small movements — translate by 4px–12px max. Large travel distances feel unprofessional.
Scale conservatively — scale(1.02) for hover lift, scale(1.05) maximum. Never beyond.
No gratuitous rotation — max 3deg for a tilt effect. Zero for most components.
Shadow is subtle — animate shadow size and opacity gently; avoid abrupt shadow jumps.
Combine opacity + transform — a fade that also moves 8px upward reads as intentional, not accidental. A raw opacity fade alone looks like a mistake.
Stagger reveals — grid items, nav links, and list items should enter with a 50ms offset per item, not all at once.
Exits are faster than entrances — entering: 300ms ease-decelerate. Exiting: 200ms ease-accelerate.
Component animation states
Every interactive component defines these eight states. Define them all, even if some are identity transforms. Consistency means no surprises.
/* Animate card when its checkbox is checked */.card:has(input:checked) {
transform: scale(1.02);
box-shadow: 0002pxvar(--color-primary);
}
/* Stagger only when section is in viewport */.section:has(.is-visible) .item {
animation: fade-up 0.4svar(--ease-decelerate) both;
}
Do not merely slow down animations for reduced-motion — remove them. The preference is about vestibular impact, not aesthetics.
Micro-interaction details (polish)
Exact values — these are thresholds, not suggestions:
Never transition: all. Always name the properties: transition-property: transform, opacity. all animates unintended properties and can trigger layout.
Scale on press: scale(0.96). Never below 0.95 — anything smaller feels exaggerated. (0.97 idle-press elsewhere in this doc is fine; 0.96 is the tactile default for buttons.)
Interruptible vs one-shot. Use CSS transitions for interactive state changes (hover/active/focus) — they can be interrupted mid-flight. Reserve @keyframes for staged sequences that run once (hero entrance, toast). Don't drive interactive state with keyframes.
Icon swaps: cross-fade, don't toggle display. Animate opacity 0→1, scale 0.25→1, blur 4px→0. With a motion library: spring, duration 0.3, bounce 0 (bounce always 0). Without one: keep both icons in the DOM (one absolute) and cross-fade with cubic-bezier(0.2, 0, 0, 1).
Skip entrance animation on first paint where a reveal would otherwise replay on load/tab-restore (e.g. initial={false} in AnimatePresence). Reveals must enhance already-visible content — never gate visibility on a transition that pauses on hidden tabs.
Quality checklist
Before delivering any animation code, verify each item:
Purposeful — does this motion communicate something the user needs to know?
GPU-only — animates only transform, opacity, filter, or clip-path
Reduced-motion handled — fallback defined at CSS, Tailwind, or JS layer
Duration on-token — uses --duration-* variables, not arbitrary values
Scale within bounds — ≤ scale(1.05) for hover, ≤ scale(1.02) for idle pulse
Movement within bounds — translate ≤ 12px except for intentional drawer/modal slides
Touch-friendly — hover effects are additive, not required for usability
No layout animation — no width, height, margin, padding, top, left
Exit faster than enter — exit transition ≤ 66% of enter duration
No will-change abuse — only on elements that will animate within 100ms