Flexbox joins the gap property
Chromium engines are picking up support for gap in flexbox, the feature long available in CSS Grid. The change is the headline of the official web.dev announcement, and it removes a persistent annoyance from a widely used layout mode.
.flex-parent {
display: flex;
gap: 1rem;
}
.flex-child {
flex: 1;
}
The old workarounds
Spacing flex items deliberately has always required a workaround. justify-content: space-between spreads items along the main axis but gives the container no explicit amount; for that, developers typically fall back to margin, which forces you to suppress the margin on the first or last item depending on direction and quickly makes the rules convoluted. The gap property addresses this directly: it is the mechanism Grid already uses, and it is a cleaner fit for flex containers as well.
Support and feature detection
For now, compatibility is muted. Safari does not support the feature yet, and neither does stable Chrome, so gap cannot simply be dropped into flexbox layouts and expected to work. Feature detection via an @supports query is the expected path, though that brings its own complications.
/* Nope, sorry. This "works" but it doesn't
actually tell you if it works in *flexbox* or not.
This works in grid in most browsers now, so it will pass. */
@supports (gap: 1rem) {
.flex-parent {
gap: 1rem;
}
}
An overloaded property
The overlap stems from the CSS Working Group's decision to drop grid-gap in favour of the plain gap. As is usual for removed CSS names, grid-gap is expected to remain supported for the long term, while authors are directed to migrate to gap. The name now also absorbs cases previously handled by column-gap, meaning one property covers several spacing jobs. That breadth should settle over time, though not quickly.
Despite the naming debt, the change is worth taking: simpler mental models matter for the future of the language, and no serious competitor to CSS for in-browser styling is on the horizon.



