Either I'm missing something or this is just how flex works.
Given a wrapping flex container with a max-width as children wrap the parents width remains at the max-width even though by wrapping the children the width could be reduced.
This makes it impossible to align the container to the center of it's container.
Here's a codepen illustrating the issue:
https://codepen.io/rsouthgate/pen/PozPyXZ
.container {
display: inline-flex;
flex-wrap: wrap;
max-width: 300px;
}
So how can I get the container to not take up the space on the right after the wrap?