# interpolate-size / calc-size() (animate to height:auto)

Status: Chrome 129 only; Firefox and Safari not yet (2026-09). Not Baseline.  
Source: https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/interpolate-size and https://caniuse.com/?search=interpolate-size  
Page: https://designforai.dev/css/interpolate-size

Opt in with `interpolate-size: allow-keywords` and you can transition `height: 0` to `height: auto` (or `max-content`); `calc-size(auto, size + 20px)` does math on intrinsic sizes.

## HTML

```html
<details class="fx-049"><summary>Animated open/close</summary><div class="fx-049-body">Body that animates to its natural height in Chromium.</div></details>
```

## CSS

```css
:root {
  interpolate-size: allow-keywords
}
.fx-049 {
  font-family: system-ui;
  max-width: 360px
}
.fx-049::details-content {
  height: 0;
  overflow: clip;
  transition: height .3s,content-visibility .3s allow-discrete
}
.fx-049[open]::details-content {
  height: auto
}
```

Fallback: Without support the panel opens instantly; no guard needed because the transition just does not interpolate.

## Prompt

For accordions and expandable panels, set `interpolate-size: allow-keywords` on `:root` and transition `height` between `0` and `auto` (or use `calc-size(auto, size)`); do not use `max-height: 9999px` hacks or grid-row tricks. Firefox and Safari fall back to an instant open, which is acceptable.
