property
Animation trigger — CSS reference
Experimental draft: The trigger draft binds an animation to a named trigger and action, rather than always starting as soon as animation declarations apply. The trigger must also be defined and in scope; the animation shorthand resets this property. A native button and class change offer an explicit accessible alternative; reduced motion should bypass decorative animation.
Formal Syntax & Structure
css syntaxcss
animation-trigger: --reveal play;Working Example
Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>animation-trigger</title><style>body{margin:0;background:white}#a{box-sizing:border-box}@keyframes fade{from{opacity:0}to{opacity:1}}#a{opacity:1;animation-trigger:--reveal play}#a.active{animation:fade 1s linear both}@media(prefers-reduced-motion:reduce){#a.active{animation:none}}</style><body><button id="start">Reveal</button><div id="a">Details</div><script>document.getElementById("start").onclick=()=>a.classList.add("active")</script></body></html>