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

Defer 'align' behavior to CSS via 'justify-items: legacy' #3428

Open
fantasai opened this issue Jan 29, 2018 · 3 comments
Open

Defer 'align' behavior to CSS via 'justify-items: legacy' #3428

fantasai opened this issue Jan 29, 2018 · 3 comments

Comments

@fantasai
Copy link
Contributor

https://html.spec.whatwg.org/multipage/rendering.html#the-css-user-agent-style-sheet-and-presentational-hints

When a user agent is to align descendants of a node, the user agent is expected to align only those descendants that have both their 'margin-inline-start' and 'margin-inline-end' properties computing to a value other than 'auto', that are over-constrained and that have one of those two margins with a used value forced to a greater value, and that do not themselves have an applicable align attribute. When multiple elements are to align a particular descendant, the most deeply nested such element is expected to override the others. Aligned elements are expected to be aligned by having the used values of their margins on the line-left and line-right sides be set accordingly. [CSSLOGICAL] [CSSWM]

The CSS Box Alignment spec added a legacy value to justify-items to handle the block-level behavior of the HTML align attribute (when it is used for alignment rather than floating): https://drafts.csswg.org/css-align/#justify-items-property It seems its being implemented, so maybe HTML can update to use that instead of defining magic behavior. (You'd need to declare both justify-items and text-align on the element triggering alignment; text-alignment and block-alignment are independent effects in CSS.)

@annevk
Copy link
Member

annevk commented Jan 30, 2018

From the blink-dev thread I got the impression that it was only implemented for Grid Layout, not as a generic, and therefore wouldn't end up working here.

@fantasai
Copy link
Contributor Author

It's defined to work in block layout, so it should eventually work . If it's not the intention of HTML to use this feature, then it should be removed from CSS. Please let me know if this is the case.

@annevk
Copy link
Member

annevk commented Jan 31, 2018

We'd use it if it gets implemented, tested, and browsers remove the bits they currently have in place. I'd rather not remove the current prose until that is all a bit clearer.

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

No branches or pull requests

2 participants