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-align] justify-items: legacy fails to fulfil its only purpose of explaining <center> and align #11463

Open
Loirooriol opened this issue Jan 9, 2025 · 0 comments
Labels

Comments

@Loirooriol
Copy link
Contributor

https://drafts.csswg.org/css-align/#valdef-justify-items-legacy

This keyword causes the value to effectively inherit into descendants.

If the legacy keyword appears on its own (without an accompanying left, right, or center keyword): if the inherited value of justify-items includes the legacy keyword, this value computes to the inherited value; otherwise it computes to normal.

When justify-self:auto references the value of justify-items, only the alignment keyword, not the legacy keyword, is referenced by it. It exists to implement the legacy alignment behavior of HTML’s <center> element and align attribute.

Well, it fails to fulfill its only purpose, because <center> and align allow automatic sizes to stretch.

https://drafts.csswg.org/css-align/#justify-self-property

Values other than stretch cause a width/height of auto to be treated as fit-content.

<!DOCTYPE html>
<div align="center">
  <div style="border: solid">foo</div>
</div>
<div style="justify-items: legacy center">
  <div style="border: solid">foo</div>
</div>

In Blink:

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

1 participant