-
Notifications
You must be signed in to change notification settings - Fork 688
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-anchor-position-1] Automatic alignment / justification #9269
Comments
One thing I want to note regarding the automatic alignment: it would be very nice to support the transitions for when the element switches tracks. Details and videos (hiding as they take a lot of vertical space)I'm currently playing with the proposed Screen.Recording.2023-09-02.at.14.57.09.movIn the above video we can see how the alignment change without a transition when the element's position changes from Basically, we'd want the alignment to be a part of the final edit: Managed to update the method I'm using for aligning so it is now transition-friendly (updated the codepen): Screen.Recording.2023-09-02.at.15.36.08.movUsing transition for the grid columns and rows from |
In the Anchor Positioning Exploration proposal, the used position area implies the default alignment / justification. For example, if the center track is used, then the default alignment is
anchor-center
.Now that we agreed to add
inset-area
to the spec (#9145 (comment)), it also seems useful to further adopt default alignment to the current spec.Proposal
When the value of
align-self
/justify-self
isnormal
, and theinset-area
on the corresponding axis contains thecenter
track, thennormal
behaves asanchor-center
.Note
The original proposal also sets default alignment for the
start
andend
tracks, but I don't think they are still needed in the context ofinset-area
, because e.g.inset-area: start
will be resolved intoinset-something: anchor(start)
, which already automatically align the element with the start edge of the anchor; same for theend
track.The text was updated successfully, but these errors were encountered: