Skip to content

CSS calc-size() and interpolate-size #1008

@o-t-w

Description

@o-t-w

Description

Enables animating to height: auto; and other intrinsic sizing keywords in CSS.

:root {
    interpolate-size: allow-keywords; 
}

The CSS interpolate-size property allows a page to opt in to animations and transitions of CSS intrinsic sizing keywords such as auto, min-content, fit-content, etc.

Particularly useful for animating between height: 0 and a content-based height e.g. for a details/summary accordion animation.

The CSS calc-size() function is a CSS function similar to calc(), but that also supports operations on exactly one of the values auto, min-content, max-content, fit-content, stretch, or contain, which are the intrinsic sizing keywords.

Chrome blog post.

Available in Chrome/Edge as of 129.

Specification

https://www.w3.org/TR/css-values-5/#calc-size

web-feature

https://web-platform-dx.github.io/web-features-explorer/features/calc-size/
https://web-platform-dx.github.io/web-features-explorer/features/interpolate-size/

Test Links

https://wpt.fyi/results/css/css-values/calc-size?label=master&label=experimental&aligned&q=calc-size

Additional Signals

Mozilla Standard Position

Webkit Standard Position

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions