-
Notifications
You must be signed in to change notification settings - Fork 673
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-flexbox][css-align] Proposal: justify-items
and justify-self
to align flex items that are alone on their line
#11244
Comments
It seems to me what you actually want is |
That may well be what I want (though I think what I proposed is more powerful because it would allow setting the "fallback alignment" of individual items). In any case, is it even possible to change the fallback alignment? Is there a proposal for it?
Yes, I'm familiar with that option. Unfortunately, the spacing on the sides is a dealbreaker. |
Well, yes, but it seems very weird if it only applies when there is no other item on the line.
I don't know, but it seems reasonable and straightforward, e.g Could also be useful to e.g. choose unsafe fallbacks. |
I think you need a new container query that detects if flex-wrap: wrap is triggered. |
How can a container query detect if flex-wrap: wrap is triggered? If you're suggesting I just figure out the exact container width at which it happens and then hardcode that in the container query, that's not a good solution for me. :P |
Filed #11259 about choosing the fallback alignment. |
Ok, I have to say that this is a very rough/raw idea, but the problem it would solve is a real one: there's currently no way to have a flex container with
justify-content: space-between
andflex-wrap: wrap
and control the horizontal alignment ("justification"?) of the items that end up alone on their line (they are always start-aligned, at least in LTR). A workaround exists to make them end-aligned, but I couldn't find any to make them center-aligned. What if it was as simple as this?Or, a more concrete example where we only want to center-align a specific item when it wraps:
Check out that example on Codepen. There is currently no way to center-align the copyright notice without using a media query, which is just sad.
The text was updated successfully, but these errors were encountered: