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-position][css-align] How do other alignments affect the inset-modified containing block? #6607

Closed
Loirooriol opened this issue Sep 13, 2021 · 5 comments
Labels
Closed Accepted as Editorial Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. css-align-3 Current Work css-position-3 Current Work

Comments

@Loirooriol
Copy link
Contributor

Loirooriol commented Sep 13, 2021

https://drafts.csswg.org/css-position/#abspos-insets says

If both inset properties in a given axis are auto, then, depending on the box’s self-alignment property in the relevant axis:

  • for self-start alignment or its equivalent
    Set its start-edge inset property to the static position, and its end-edge inset property to zero.
  • for self-end alignment or its equivalent
    Set its end-edge inset property to the static position, and its start-edge inset property to zero.
  • for center alignment
    ...

What should happen for other alignments? Like, the initial justify-self is auto, which is typically normal. https://drafts.csswg.org/css-align-3/#justify-abspos

For all other absolutely-positioned boxes, normal behaves as stretch.

So what's the inset-modified containing block for stretch? Are we instead supposed to use https://drafts.csswg.org/css-align-3/#abspos-sizing ?

Treat normal as start

That seems to match implementations. But what if I specify justify-self: stretch explicitly?

This is all very confusing because both css-position and css-align monkeypatch both css2 and each other.

@Loirooriol Loirooriol added css-align-3 Current Work css-position-3 Current Work labels Sep 13, 2021
@fantasai
Copy link
Collaborator

@Loirooriol Fixed by inserting “(treating normal as start and any distributed, baseline, or stretch alignment value as its fallback alignment)”. Let us know if this addresses the issue.

@Loirooriol
Copy link
Contributor Author

I don't think self-alignment (align-self/justify-self) accepts distributed alignment values, though? Instead, it accepts other positional alignments which are not handled?

@fantasai
Copy link
Collaborator

@Loirooriol Which other alignments are not handled?

@Loirooriol
Copy link
Contributor Author

Well, it's not clear what to do if <overflow-position> is specified. Is it just ignored and we only consider the <self-position>? safe can make the alignment behave as start, which I guess is handled anyways as an equivalent of either self-start or self-end. But here we are determining the inset-modified containing block into which it will be aligned. So I guess we don't know yet if it will overflow or not.

And normal is not explicitly handled, but it behaves as some other value, so maybe it's handled as that value? But not all handled cases say "or its equivalent".

@fantasai
Copy link
Collaborator

fantasai commented Jan 6, 2023

@Loirooriol Fixed. Please close out if you're satisfied!

@Loirooriol Loirooriol added Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. and removed Commenter Response Pending labels Jan 9, 2023
jakearchibald pushed a commit to jakearchibald/csswg-drafts that referenced this issue Jan 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closed Accepted as Editorial Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. css-align-3 Current Work css-position-3 Current Work
Projects
None yet
Development

No branches or pull requests

2 participants