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 with justify-content
or align-items
, at least). This makes for some awesome layout opportunities that are perfect for grids, modal footers, cards, and more.