Skip to content
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

[css-grid-2] Clarification on explicit placement order vs. implicit grid line creation #11771

Open
gitspeaks opened this issue Feb 25, 2025 · 1 comment

Comments

@gitspeaks
Copy link

In 8.5. Grid Item Placement Algorithm, I'm confused about the separation between the placement of items (in step 1, "Position anything that’s not auto-positioned") and the creation of implicit grid lines (in step 3, "Determine the columns in the implicit grid.", subsection 2).

Step 1 appears to include explicitly placed grid items that might reference grid line numbers outside the bounds defined by the explicit grid template.

Then, in step 3.2, the algorithm generates implicit grid lines based on all items with a definite column position (including those explicitly placed in step 1).

My confusion comes from how an item can be positioned using a grid line number that hasn't been "materialized" yet. Is it intentional that items can be positioned using these numbers before the corresponding implicit grid lines are created? If so, could the spec clarify the difference between using a grid line number as a placement reference and the later "materialization" of that grid line in the implicit grid?

A similar question applies to Step 2 "Process the items locked to a given row". If grid items may reference row grid lines outside the explicit grid template. How is it handled if the referenced rows haven't been generated yet?

Thanks!

@gitspeaks
Copy link
Author

I would expect Step 1 to start something like:

  1. For each item with definite row and column:
    1.1. Extend grid lines as needed (materialize implicit tracks).
    1.2. Place the item and mark the occupied grid area

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant