Skip to content

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

Description

@mkrause

Description

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. A common use case is to transition between height: 0 and height: auto, for example in accordion components.

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

Closely related is the new calc-size() function, which allows you to perform calculations on intrinsic size values (not supported by the regular calc() function).

.foo {
  width: calc-size(min-content, size + 100px);
}

These features are supported in Chrome v129.

References:

Specification

web-feature

Test Links

https://wpt.fyi/results/?label=master&aligned&q=feature%3Acalc-size%20or%20feature%3Ainterpolate-size

Additional Signals

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions