keyword

Step start — CSS reference

Equivalent to steps(1,jump-start). Jumps to the destination at the start of the active interval.

Formal Syntax & Structure

css syntaxcss
step-start

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>step-start</title><style>body{margin:0}#a{padding:8px;background:rgb(232,237,241);color:rgb(0,0,0);box-sizing:border-box}#a{width:100px;height:60px;opacity:0.2;background:#2855ac;color:white;padding:0;transition:opacity 1000ms linear}#a.active{opacity:1;width:200px}#a{transition-timing-function:step-start}</style><body><button id="toggle" type="button">Toggle panel</button><div id="a">Panel</div><script>const a=document.querySelector("#a");const toggle=document.querySelector("#toggle");toggle.onclick=()=>a.classList.toggle("active");function start(){getComputedStyle(a).opacity;getComputedStyle(a).width;toggle.click();getComputedStyle(a).opacity;getComputedStyle(a).width;return a.getAnimations()}async function sample(t,p="opacity"){const anim=start().find(x=>x.transitionProperty===p);if(!anim)return null;anim.pause();await anim.ready;anim.currentTime=t;return getComputedStyle(a).getPropertyValue(p)}</script></body></html>
CSS Reference