Skip to content

[css-sizing-3][css-sizing-4] Move fit-content keyword to Level 3 and fit-content() function to Level 4 #10601

Closed

Description

@SebastianZ

Back in 2017, it was resolved to defer the fit-content keyword level 4 of the Sizing spec. together with the stretch keyword.

Though it looks like in the meantime all major browser engines implemented this keyword already. Interestingly, they don't support the stretch keyword yet while the spec. refers to fit-content being equivalent to fit-content(stretch) (which is actually not allowed at the moment, because fit-content() currently only takes a <length-percentage>).

At the same time, the fit-content() function is not supported by any browser so far. There's only an experimental implementation in Firefox.
So, fit-content doesn't seem to be dependent on fit-content().

Therefore, I suggest to revert the resolution of #1912 and move the fit-content keyword back to level 3, and instead defer the fit-content() function to level 4.

Sebastian

Activity

  1. yisibl commented on Nov 5, 2024

    @yisibl
    Contributor

    I would suggest migrating the stretch keyword back to Level 3 as well.

    • Chrome and Safari have long supported -webkit-fill-available with the prefix -webkit-fill-available.
    • Firefox supports -moz-available.
    • Recently Chrome has been removing prefixes and is available for testing in Canary.

    cc @davidsgrogan

  2. yisibl commented on Oct 11, 2025

    @yisibl
    Contributor

    Additionally, the definition of css-sizing-4 is missing the flex-basis property.

    https://drafts.csswg.org/css-sizing-4/#sizing-values

    Image
  3. Loirooriol commented on Oct 11, 2025

    @Loirooriol
    Contributor

    The grammar of flex-basis is content | <‘width’>, so it's already covered. Listing flex-basis there would add a duplicate which I think is bad for webref

  4. SebastianZ commented on Oct 11, 2025

    @SebastianZ
    ContributorAuthor

    I believe, this change is relatively uncontroversial. So maybe we can resolve on that asynchronously.

    The proposal is: Move the fit-content and stretch keywords from CSS Sizing 4 to level 3 and the fit-content() function from level 3 to 4.

    Also, the reference to fit-content(stretch) needs to be removed from the definition of the fit-content keyword.

    Sebastian

  5. astearns commented on Oct 13, 2025

    @astearns
    Member

    I’m not sure I agree with moving stretch back, if there are no implementations of the keyword as-is yet.

  6. Loirooriol commented on Oct 13, 2025

    @Loirooriol
    Contributor

    @astearns Blink and Servo have shipped stretch. And Gecko has started implementing it behind a pref, planning to enable it by the end of the year.

    https://chromestatus.com/feature/6176445286842368
    https://groups.google.com/a/mozilla.org/g/dev-platform/c/JCUC9RJ74M8/m/6j0tFafoBAAJ

  7. astearns commented on Oct 20, 2025

    @astearns
    Member

    The CSSWG will automatically accept these resolutions one week from now if no objections are raised here. Anyone can add an emoji to this comment to express support. If you do not support these resolutions, please add a new comment.

    Proposed Resolutions:

    • Move the fit-content and stretch keywords from CSS Sizing 4 to level 3
    • Move the fit-content() function from CSS Sizing 3 to level 4.
    • Remove the reference to fit-content(stretch) from the definition of the fit-content keyword
  8. astearns commented on Oct 27, 2025

    @astearns
    Member

    RESOLVED: Move the fit-content and stretch keywords from CSS Sizing 4 to level 3
    RESOLVED: Move the fit-content() function from CSS Sizing 3 to level 4.
    RESOLVED: Remove the reference to fit-content(stretch) from the definition of the fit-content keyword

  9. yisibl commented on Sep 1, 2026

    @yisibl
    Contributor

    It looks like this issue can be closed. b1ebca4

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