-
-
Notifications
You must be signed in to change notification settings - Fork 79k
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
v4: Mixing auto margins with flexbox #21426
Conversation
Correct me if i'm wrong, but |
Huh, never thought about it being in a flex container. Most of the sources I saw online were before flexbox, so that's where I must have got the idea that For completeness, I think you should also add the |
// Some special margin utils | ||
@include media-breakpoint-up($breakpoint) { | ||
$infix: breakpoint-infix($breakpoint, $grid-breakpoints); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line contains trailing whitespace
Turns out auto margins and flexbox make an amazing team. I discovered this while working on #21425 and really wanted to put something together for it. Using
margin-{direction}: auto
on a flex item will automatically place it on the opposite end of the flex items (when mixed withjustify-content
oralign-items
, at least). This makes for some awesome layout opportunities that are perfect for grids, modal footers, cards, and more.