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

Só Chrome 129; Firefox e Safari ainda não (2026-09). Não é Baseline.

Chrome 129Edge 129Safari noFirefox no

Opte com `interpolate-size: allow-keywords` e você consegue transicionar `height: 0` para `height: auto` (ou `max-content`); `calc-size(auto, size + 20px)` faz matemática com tamanhos intrínsecos.

Animated open/close
Body that animates to its natural height in Chromium.
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
}
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>

Fallback: Sem suporte o painel abre instantaneamente; nenhuma proteção necessária porque a transição simplesmente não interpola.

Fonte: developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/interpolate-size and https://caniuse.com/?search=interpolate-size

Prompt

Para acordeões e painéis expansíveis, defina `interpolate-size: allow-keywords` em `:root` e transicione `height` entre `0` e `auto` (ou use `calc-size(auto, size)`); não use hacks de `max-height: 9999px` nem truques de grid-row. Firefox e Safari caem para uma abertura instantânea, o que é aceitável.