height: auto, animated with CSS

Flip the switch and open the card: same CSS, one property apart.

Release notes, the long version

Most cards on the web hide part of their text behind a “Show more” button.

For years, the honest way to animate that reveal was impossible in CSS: the browser can’t interpolate between 0 and auto.

So we faked it with max-height guesses that cut long text or made the animation lag, or we measured the element with JavaScript.

With interpolate-size: allow-keywords, auto becomes a valid end point. The browser works out the real height and animates to it.

Turn the switch off and this same panel snaps open instantly, because numeric-only is the default.

block-size now 0px

Native <details> + ::details-content

Why isn’t it on by default?

Many sites rely on transitions to auto not animating. Turning it on everywhere would break them, so you opt in, usually once on :root.

Can I go from min-content to max-content?

No. One end has to be a length or a percentage. Keyword to keyword still jumps.

What does it cost?

Size animations run layout on every frame. Keep them for small, deliberate reveals like this one.