CSS contain-intrinsic-size

The contain-intrinsic-size property allows developers to specify a placeholder size which would be used while contain: size is applied. With contain-intrinsic-size specified, elements lay out as if they had a single child with fixed size (specified by contain-intrinsic-size) unless they have an explicit width/height. This is helpful when size containment may be dynamically added/removed so that there is a fallback size during size containment but a content-based size during regular sizing.

The motivation for the property is to provide a placeholder sizing for subtree content which is either not yet available or not rendered. There is currently no way to provide this, other than sizing the element itself which may not be desirable as it affects how the element lays out in its container.

Comments

This feature has gone through some renames and was previously known as content-size and intrinsic-size, with different semantics (but was never shipped with those names).

Documentation

Specification

Editor's draft

Status in Chromium

Blink>Layout


Enabled by default (tracking bug) in:

  • Chrome for desktop release 83
  • Chrome for Android release 83
  • Android WebView release 83

Consensus & Standardization

After a feature ships in Chrome, the values listed here are not guaranteed to be up to date.

Owners

Intent to Prototype url

Intent to Prototype thread

Last updated on 2020-05-29