Skip to content

Fix: Clarified misleading statements in Grid Layout page (#39875) #39904

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

ashish-2106
Copy link

Fixes #39875

Summary of changes:

  • Updated the "Implicit and explicit grids" section to clarify that the size of implicit tracks with default auto sizing is influenced by both content and available free space, rather than just content alone.
  • Updated the "Track sizing and minmax" section to clarify how auto works as the maximum value — it allows the track to grow based on content up to its max-content size while sharing free space within the grid container.

These changes follow the suggestions from the issue reporter and improve the accuracy of documentation for CSS Grid behavior.

This is my first contribution to mdn/content — happy to assist further if needed 🚀.

@ashish-2106 ashish-2106 requested a review from a team as a code owner June 11, 2025 16:10
@ashish-2106 ashish-2106 requested review from estelle and removed request for a team June 11, 2025 16:10
@github-actions github-actions bot added Content:CSS Cascading Style Sheets docs size/xs [PR only] 0-5 LoC changed labels Jun 11, 2025
Copy link
Contributor

@@ -316,7 +316,7 @@ When creating our example grid, we specifically defined our column tracks with t
The _explicit grid_ consists of rows and columns defined with {{cssxref("grid-template-columns")}} or {{cssxref("grid-template-rows")}}. The
_implicit grid_ extends the defined explicit grid when content is placed outside of that grid, such as into the rows by drawing additional grid lines.

If you place something outside of the defined grid—or due to the amount of content, more grid tracks are needed—then the grid creates rows and columns in the _implicit grid_. These tracks will be auto-sized by default, resulting in their size being based on the content that is inside them.
If you place something outside of the defined grid—or due to the amount of content, more grid tracks are needed—then the grid creates rows and columns in the _implicit grid_. These tracks will be auto-sized by default, meaning their size is influenced both by the content inside them and by the available free space within the grid container. The "auto" keyword allows the track to accommodate content while also sharing any remaining space.
Copy link
Member

Choose a reason for hiding this comment

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

Need to be explicit about where the auto keyword is added (use backtick (`), not quotes (") for demarking keywords)

here is my suggestion for the rest:

Suggested change
If you place something outside of the defined grid—or due to the amount of content, more grid tracks are neededthen the grid creates rows and columns in the _implicit grid_. These tracks will be auto-sized by default, meaning their size is influenced both by the content inside them and by the available free space within the grid container. The "auto" keyword allows the track to accommodate content while also sharing any remaining space.
If you place something outside of the defined grid or, due to the amount of content, more grid tracks are needed, then the grid creates rows and columns in the _implicit grid_. These tracks will be auto-sized by default, meaning their size is influenced both by the content that is inside them and by the available free space within the grid container.

Copy link
Author

Choose a reason for hiding this comment

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

Hi @estelle 👋,

I have applied the suggested changes as per your feedback. Please have a look when convenient. Thank you! 🚀

@@ -316,7 +316,7 @@ When creating our example grid, we specifically defined our column tracks with t
The _explicit grid_ consists of rows and columns defined with {{cssxref("grid-template-columns")}} or {{cssxref("grid-template-rows")}}. The
_implicit grid_ extends the defined explicit grid when content is placed outside of that grid, such as into the rows by drawing additional grid lines.

If you place something outside of the defined gridor due to the amount of content, more grid tracks are neededthen the grid creates rows and columns in the _implicit grid_. These tracks will be auto-sized by default, resulting in their size being based on the content that is inside them.
If you place something outside of the defined grid or due to the amount of content, more grid tracks are needed, then the grid creates rows and columns in the _implicit grid_. These tracks will be auto-sized by default, meaning their size is influenced both by the content that is inside them and by the available free space within the grid container. The `auto` keyword allows the track to accommodate content while also sharing any remaining space.
Copy link
Member

Choose a reason for hiding this comment

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

Which property/ies is this auto referencing?

Copy link
Author

Choose a reason for hiding this comment

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

In this context, the auto keyword refers to the track sizing function used in properties like grid-template-columns, grid-template-rows, grid-auto-columns, and grid-auto-rows. Specifically, when implicit grid tracks are created (for example, via grid-auto-rows), their default sizing is auto, meaning the track size depends on its content (similar to max-content) and can expand to fit the content within available space.

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 size/xs [PR only] 0-5 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Statement is misleading
2 participants