← Back to release summary

Gutters in flexbox: row-gap and column-gap properties

Category
CSS
Type
New or changed feature
Status
Enabled by default (Chrome 84)
Intent stage
Shipped

WPT details: 5/28 update after implementation: there are now about 25 tests, all in WPT. From I2P: Not yet _fully_ tested. There are 4 tests at https://wpt.fyi/results/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox?label=master&label=experimental&aligned&q=row-gap

Summary

This css property allows you to specify spacing between flex items and/or flex lines.

Motivation

Developers can get close to this functionality with the margin and padding properties but there are limitations. Cribbing from https://gist.github.com/OliverJAsh/7f29d0fa1d35216ec681d2949c3fe8b7 : margin collapsing would break gutters when nesting gutter containers, e.g. https://jsfiddle.net/OliverJAsh2/Lwxyt07p/6/ any width specified on the gutter item would not be inclusive of the gutter, e.g. https://jsfiddle.net/OliverJAsh2/p8e50c6m/1/

Standards & signals

Ecosystem

Docs: https://developer.mozilla.org/en-US/docs/Web/CSS/row-gap

Samples: https://jsbin.com/jibudiyene/edit?html,css,output

Explainers: https://developer.mozilla.org/en-US/docs/Web/CSS/column-gap#Flex_layout

View on chromestatus.com