← Chrome 149 reference

v149 · css · shipped

CSS Gap Decorations

Style the gaps in Grid and Flexbox layouts the way you can already style gutters in multi-column layout. Adds row-rule and extends column-rule to every gap-aware container.

at a glance

Shipped inChrome 149 (desktop + Android)
StatusEnabled by default
FlagNone
Standards positionWebKit: support  ·  Mozilla: support (see browsers below)
SpecCSS Gaps Module Level 1 (W3C CSSWG editor's draft)
ExplainerMicrosoftEdge / MSEdgeExplainers / CSSGapDecorations
ChromeStatus5157805733183488 — CSS Gap Decorations

why it exists

Until Chrome 149, web authors styled gaps in Grid and Flexbox layouts with hacks: nested backgrounds, fake borders on every item, or absolutely positioned overlays. column-rule in multi-column layout already lets you draw a line in each gutter; gap decorations brings the same primitive to every gap-aware layout and adds row-rule for horizontal gaps.

Source: chromestatus motivation field.

the properties

Three groups, mirroring the existing column-rule shorthand. row-rule is brand new. rule is a higher-level shorthand that sets both at once.

column-rule

column-ruleShorthand: <width> <style> <color>
column-rule-colorColour of the rule drawn in column gaps
column-rule-styleOne of solid | dashed | dotted | double | groove | ridge | inset | outset | none | hidden
column-rule-widthWidth of the rule, e.g. 2px, thin, medium
column-rule-breakWhether the rule breaks across grid lines or runs continuous
column-rule-insetInset from the gap edges (per-side variants exist)

row-rule

row-ruleShorthand: <width> <style> <color>
row-rule-colorColour of the rule drawn in row gaps
row-rule-styleSame vocabulary as column-rule-style
row-rule-widthWidth of the rule
row-rule-breakWhether the rule breaks at intersections or runs continuous
row-rule-insetInset from the gap edges

rule (shorthand)

ruleSets both column-rule and row-rule at once.
rule-color / rule-style / rule-widthPer-axis if you split. Otherwise applies to both axes.
Source: CSS Gaps Module Level 1 §3 property index.

live example

The grid below has a 3px solid blue rule in column gaps and a 3px dashed emerald rule in row gaps. View source on this page to inspect the CSS.

1
2
3
4
5
6
.demo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;

  column-rule: 3px solid #0022ff;
  row-rule:    3px dashed #0a8f5c;
}

recipes

One rule for every gap

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  rule: 2px solid currentColor;
}

Inset the rule so it doesn't touch the children

.toolbar {
  display: flex;
  gap: 0.75rem;
  column-rule: 1px solid #aaa;
  column-rule-inset: 0.25rem;
}

Different rules per axis

.cards {
  display: grid;
  gap: 1rem;
  column-rule: 1px dotted oklch(70% 0.02 240);
  row-rule: 2px solid oklch(50% 0.18 30);
}

browser support

Chrome149 (desktop + Android)
Edge149 (Chromium)
FirefoxPublic support (no ship date yet)
SafariPublic support (no ship date yet)
Source: chromestatus browser views (ff_views, safari_views) at time of generation. Check the live entry for the latest signal.

see also