property
Interpolate size — CSS reference
Opts into interpolation between a numeric length-percentage and supported intrinsic size keywords such as auto or max-content. It is inherited; scope it to components when global opt-in would change existing animations. Two different intrinsic keywords are not made directly interpolable by this setting. The example scrubs an animation at its midpoint rather than depending on a timer.
Formal Syntax & Structure
css syntaxcss
interpolate-size: allow-keywords;Working Example
Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>interpolate-size</title><style>body{margin:16px;font:16px/1.5 system-ui;background:white;color:#172033} .demo{background:#dbeafe;box-sizing:border-box} button,select{font:inherit}#a{interpolate-size:allow-keywords;width:100px}#a>span{display:block;width:200px}</style><body><div id="a" class="demo"><span>Content</span></div><script>function midpoint(){let a=document.querySelector("#a");let t=a.animate([{width:"100px"},{width:"auto"}],{duration:1000,fill:"both"});t.pause();t.currentTime=500;return a.getBoundingClientRect().width}</script></body></html>