Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The interpolate-size
CSS property allows you to enable animations and transitions between a <length-percentage>
value and an intrinsic size value such as auto
, fit-content
, or max-content
.
This property is typically used to animate the width
and/or height
of a container between a <length-percentage>
and the full size of its content (i.e. between "closed" and "open" or "hide" and "reveal" states) when animating a non-box-model CSS property, such as transform
, is not a viable solution.
Note: The behavior opted-into by interpolate-size
cannot be enabled by default across the web because many sites in the wild use stylesheets that assume intrinsic size values cannot be animated. Enabling it by default would cause several backwards-compatibility issues (see relevant CSS WG discussion).