Skip to content

Conversation

@dipikabh
Copy link
Contributor

@dipikabh dipikabh commented Jul 4, 2025

Description

A user on Discord reported that the description for fit-content was misleading and unclear.

I also found that the reference to fit-content(stretch) is outdated and should be removed.
From CSS Box Sizing Level 3 spec:
> Note: This section previously defined stretch and fit-content as keywords representing the stretch-fit size and fit-content size, respectively. These keywords have been deferred to Level 4 (along with an additional contain keyword that behaves similarly to stretch but preserves the preferred aspect ratio, if any) to better work out the implications in situations with indefinite available space.

Updates in this PR

  • Improved and clarified the description of fit-content.
    • Removed the outdated reference to fit-content(stretch). Updated the note.
    • Moved the formula to the "Description" section.
  • Made the language and structure more consistent across other related sizing keyword pages: max-content and min-content.
  • Made light edits to the related glossary page for Intrinsic size.
    • Converted the subsection on "Extrinsic size" into a new glossary entry.

Motivation

To ensure content is accurate, up-to-date, and easier to understand

@dipikabh dipikabh requested review from a team as code owners July 4, 2025 04:01
@dipikabh dipikabh requested review from estelle and pepelsbey and removed request for a team July 4, 2025 04:01
@github-actions github-actions bot added Content:CSS Cascading Style Sheets docs Content:Glossary Glossary entries size/m [PR only] 51-500 LoC changed labels Jul 4, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Jul 4, 2025

Preview URLs (7 pages)
Flaws (5)

Note! 2 documents with no flaws that don't need to be listed. 🎉

URL: /en-US/docs/Glossary/Extrinsic_size
Title: Extrinsic size
Flaw count: 1

  • broken_links:
    • /en-US/docs/Web/CSS/Containing_block is a redirect

URL: /en-US/docs/Web/CSS/CSS_box_sizing/Understanding_aspect-ratio
Title: Understanding and setting aspect ratios
Flaw count: 1

  • macros:
    • Macro produces link /en-US/docs/Learn_web_development/Core/Styling_basics/Cool-looking_box which is a redirect

URL: /en-US/docs/Web/CSS/fit-content
Title: fit-content
Flaw count: 1

  • macros:
    • Macro produces link /en-US/docs/Learn_web_development/Core/Styling_basics/Cool-looking_box which is a redirect

URL: /en-US/docs/Web/CSS/max-content
Title: max-content
Flaw count: 1

  • macros:
    • Macro produces link /en-US/docs/Learn_web_development/Core/Styling_basics/Cool-looking_box which is a redirect

URL: /en-US/docs/Web/CSS/min-content
Title: min-content
Flaw count: 1

  • macros:
    • Macro produces link /en-US/docs/Learn_web_development/Core/Styling_basics/Cool-looking_box which is a redirect
External URLs (1)

URL: /en-US/docs/Glossary/Extrinsic_size
Title: Extrinsic size

(comment last updated: 2025-08-26 14:33:58)

@github-actions
Copy link
Contributor

This pull request has merge conflicts that must be resolved before it can be merged.

@github-actions github-actions bot added merge conflicts 🚧 [PR only] and removed merge conflicts 🚧 [PR only] labels Jul 11, 2025
@github-actions
Copy link
Contributor

This pull request has merge conflicts that must be resolved before it can be merged.

@github-actions github-actions bot removed the merge conflicts 🚧 [PR only] label Jul 14, 2025
- Related glossary terms:
- {{glossary("Extrinsic size")}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Related glossary terms:
- {{glossary("Extrinsic size")}}
- {{glossary("Extrinsic size")}}

we're in glossary, so don't need to include the introductory text in this section

Copy link
Contributor Author

@dipikabh dipikabh Jul 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We added this introductory label to all glossary entries some time back (per #34454, and in PRs like #34454 and #35246)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only see #34451. Was there a discussion anywhere? For other sections, I could concede to prefacing multiple terms with "Glossary terms:". However, I would have voiced opposition to this choice for this section in this format due to redundancy. We're in the "glossary", glossaries define "terms"., and the See also section should only contain "related" content, including related terms..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I see what you're saying, especially about the word "related", which could seem redundant. But also, to me "Related glossary terms:" has a different ring to it than just "Glossary terms:".

The intent to add the label in the first place was to distinguish glossary term links from other links in "See also", such as those for properties and module pages.

@dipikabh
Copy link
Contributor Author

Hi @estelle, when you have some time, could you review this PR? Thank you!

@dipikabh dipikabh requested review from estelle and removed request for pepelsbey August 7, 2025 12:58
@estelle
Copy link
Member

estelle commented Aug 8, 2025

@estelle

Copy link
Member

@estelle estelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still working on it, but committing what i have

- Related glossary terms:
- {{glossary("Extrinsic size")}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only see #34451. Was there a discussion anywhere? For other sections, I could concede to prefacing multiple terms with "Glossary terms:". However, I would have voiced opposition to this choice for this section in this format due to redundancy. We're in the "glossary", glossaries define "terms"., and the See also section should only contain "related" content, including related terms..


> [!NOTE]
> The CSS Sizing specification also defines the {{cssxref("fit-content_function", "fit-content()")}} function. This page details the keyword.
> In addition to the `fit-content` keyword, the CSS Box Sizing specification also defines the {{cssxref("fit-content_function", "fit-content()")}} function, which takes a length or percentage as an argument and behaves slightly differently.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> In addition to the `fit-content` keyword, the CSS Box Sizing specification also defines the {{cssxref("fit-content_function", "fit-content()")}} function, which takes a length or percentage as an argument and behaves slightly differently.
> In addition to the `fit-content` keyword, the [CSS box sizing](/en-US/docs/Web/CSS/CSS_box_sizing) module also defines the {{cssxref("fit-content_function", "fit-content()")}} function, which takes a {{cssxref("length")}} or {{cssxref("percentage')}} as an argument and behaves slightly differently.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do they serve the same purpose?

Copy link
Member

@estelle estelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think i understand this feature well enough to review this PR


> [!NOTE]
> The CSS Sizing specification also defines the {{cssxref("fit-content_function", "fit-content()")}} function. This page details the keyword.
> In addition to the `fit-content` keyword, the CSS Box Sizing specification also defines the {{cssxref("fit-content_function", "fit-content()")}} function, which takes a length or percentage as an argument and behaves slightly differently.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do they serve the same purpose?

@dipikabh dipikabh requested a review from estelle August 21, 2025 04:12
Copy link
Member

@estelle estelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

three more suggestions

@dipikabh dipikabh requested a review from estelle August 26, 2025 14:35
Copy link
Member

@estelle estelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! 🎉

@estelle estelle merged commit bbff081 into mdn:main Aug 28, 2025
8 checks passed
@dipikabh
Copy link
Contributor Author

Thanks for the review, Estelle!

@dipikabh dipikabh deleted the css-fit-content branch August 28, 2025 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:CSS Cascading Style Sheets docs Content:Glossary Glossary entries size/m [PR only] 51-500 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants