Skip to content

[css-sizing-4] Allow specifying only one dimension for intrinsic sizing #5432

Closed
@vmpstr

Description

@vmpstr

We have a definition of contain-intrinsic-size which specifies both width and height dimensions of the intrinsic size.

For a case of vertical scrolling, we found that it is a common desire to have the width of an element be as wide as the scroller and the height be dictated by contain-intrinsic-size. This is particularly useful with content-visibility: auto which puts in size containment when the elements scroll off screen.

We've been recommending things like contain-intrinsic-size: 1px 400px; where 400px is the desired height, but it's a bit awkward. It would be nicer and more ergonomic to be able to specify just the height of the intrinsic size.

Is it possible for us to make the contain-intrinsic-size a shorthand for contain-intrinsic-width and contain-intrinsic-height (and possibly block-size and inline-size?) with auto | <length> or something similar

That way, developers would have an option of specifying just one of the two dimensions

/cc @tabatkins @chrishtr

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