Re: [csswg-drafts] [css-align] Rules for align/justify-self on static position of absolutely-positioned boxes need more detail

OK, so, the basic principle we've been operating off of in the Alignment spec is switching out the “check `direction`” condition in CSS2.1§10 for “check the relevant alignment property”, and relying on the fact that the alignment properties key off of `direction`, providing the same behavior by default but allowing it to be controlled without misusing `direction`.

If we continue with that line of thinking for this issue, we would do the same thing: the behavior of `start` alignment is as defined in CSS2.1, and the behavior of `end` alignment is what it would be if the `direction` was reversed from what it is. Thus, since by default (i.e. for `start` alignment) we use the start edge of the static position containing block and the end edge of the containing block for the available width, then for the opposite alignment (`end`) we would use the end edge of the static position containing block and the start edge of the containing block for the available width.

The remaining question is what to do for `center`. The significant edge is the one that matches the requested alignment: the start-edge reference for `start` alignment, the end-edge reference for `end` alignment. In each of these cases, this is the static position containing block. Thus `center`, which keys off of both start and end edges, should use the static position containing block edges for both. This also has the benefit of providing a behavior that cannot otherwise be gotten—since referencing the start/end edges of the actual containing block is always possible using `left: 0; right: 0`.

So, the proposal is:
- If `justify-content` on the static position containing block is `start`, use the start edge of the 
static position containing block and the end edge of the actual containing block (as CSS2.1 requires).
- If `justify-content` on the static position containing block is `end`, use the start edge of the actual containing block and the end edge of the static position containing block.
- If `justify-content` on the static position containing block is `center`, use the start edge and end edges of the static position containing block.

where the first two are exactly what CSS2.1 requires, except with a conditional on the `justify-content` of the static position containing block substituted for the conditional on `direction` of the static position containing block, and the third is the consequence of extending that logic to centering as best we can.

-- 
GitHub Notification of comment by fantasai
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1432#issuecomment-387153116 using your GitHub account

Received on Monday, 7 May 2018 18:10:11 UTC