Intent to Prototype: CSS fit-content() function for sizing properties

95 views
Skip to first unread message

Chromestatus

unread,
8:58 AM (4 hours ago) 8:58 AM
to blin...@chromium.org, j...@chromium.org
Contact emails
j...@chromium.org

Explainer
No information provided

Specification
https://drafts.csswg.org/css-sizing-3/#funcdef-width-fit-content

Summary
Implements the fit-content(<length-percentage>) value for width, height, min-width, max-width, min-height, and max-height properties as defined by the CSS Box Sizing Module Level 3. It resolves as min(max-content, max(min-content, <length-percentage>)), clamping an element's size between its min-content and max-content while targeting the specified length or percentage. This gives developers explicit control over content-based sizing without relying on the available space, unlike the fit-content keyword which always uses the stretch size as its target.

Blink component
Blink>CSS

Web Feature ID
fit-content-function

Motivation
The fit-content keyword exists but always clamps against the available space. When developers need to clamp an element's size between its min-content and max-content using a specific length or percentage instead of the available space, there is no CSS-native way to express this.

Initial public proposal
https://drafts.csswg.org/css-sizing-3/#funcdef-width-fit-content

Goals for experimentation
None

Requires code in //chrome?
False

Tracking bug
https://issues.chromium.org/issues/40847362

Estimated milestones

No milestones specified



Link to entry on the Chrome Platform Status
https://chromestatus.com/feature/5173684820115456?gate=4535388490301440

This intent message was generated by Chrome Platform Status.
Message has been deleted

一丝

unread,
9:39 AM (3 hours ago) 9:39 AM
to blink-dev, Chromestatus, j...@chromium.org
The spec states: "The flex-basis property hereby also gains these new keywords, as its values are defined by reference to <width>"
So, will this ship include the `flex-basis` property? See also: https://github.com/browserscore/features/pull/250

jj

unread,
11:02 AM (2 hours ago) 11:02 AM
to 一丝, blink-dev, Chromestatus
On Tue, Mar 24, 2026 at 2:39 PM 一丝 <yio...@gmail.com> wrote:
>
> The spec states: "The flex-basis property hereby also gains these new keywords, as its values are defined by reference to <width>"
> So, will this ship include the `flex-basis` property? See also: https://github.com/browserscore/features/pull/250

Most likely, yes.
Reply all
Reply to author
Forward
0 new messages