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-flexbox-1] Should 'justify-content' come after resolving flexible lengths? #11406

Open
gitspeaks opened this issue Dec 22, 2024 · 4 comments
Labels

Comments

@gitspeaks
Copy link

gitspeaks commented Dec 22, 2024

According to section 9.5(12)(2):

"Align the items along the main axis per justify-content."

This step precedes section 9.7, "Resolving Flexible Lengths", in the algorithm's order. This sequence implies that the effect of justify-content might be overridden during the redistribution of available space.

However, it seems more logical that justify-content should occur if there is remaining space after the flexible lengths have been resolved.

According to: 8.2. Axis Alignment: the justify-content property:

The justify-content property aligns flex items along the main axis of the current line of the flex container. This is done after any flexible lengths and any auto margins have been resolved.

@Loirooriol Loirooriol added the css-flexbox-1 Current Work label Dec 22, 2024
@Loirooriol
Copy link
Contributor

Section 9.7 is after 9.5 but this doesn't mean that it runs later.

It's actually invoked from 9.3.

@Loirooriol Loirooriol closed this as not planned Won't fix, can't repro, duplicate, stale Dec 22, 2024
@gitspeaks
Copy link
Author

Hmm… If this happens after 9.3, why isn’t it listed as 9.4?

@Loirooriol
Copy link
Contributor

CSS specs are descriptive, not algorithmic, so the order isn't usually relevant.
The algorithmic part of CSS Flexbox that needs to be order and encompasses multiple sections is already numbered accordingly, from 1 (in §9.1) to 16 (in §9.6).

@gitspeaks
Copy link
Author

CSS specs are descriptive, not algorithmic, so the order isn't usually relevant. The algorithmic part of CSS Flexbox that needs to be order and encompasses multiple sections is already numbered accordingly, from 1 (in §9.1) to 16 (in §9.6).

All of these steps are under Section 9, Flex Layout Algorithm, so the context is indeed a description of the Flexbox algorithm. Section 9.7 provides details for a specific part of the algorithm, and as you correctly pointed out, it is to be performed after Section 9.3. However, I see no compelling reason for Section 9.7 to be separated from the main sequence of steps. It acts as a kind of subroutine, which Section 9.3 refers to, but it is not referenced again in any subsequent steps.
This separation is unnecessary and potentially confusing. I recommend integrating Section 9.7 into the flow by placing it directly after Section 9.3 (as Section 9.4) which would make the sequence more intuitive.

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

No branches or pull requests

3 participants
@Loirooriol @gitspeaks and others