CKTIS / CSS
CSS property `rule-color`
The `rule-color` shorthand sets the same list on `column-rule-color` and `row-rule-color`. `red, blue` assigns colors to successive gaps on both axes, while the initial `currentcolor` takes the container’s current color.
Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
Syntax
<'column-rule-color'>The rule-color shorthand sets the same list on column-rule-color and row-rule-color. red, blue assigns colors to successive gaps on both axes, while the initial currentcolor takes the container’s current color.
The example applies rule-color:red,blue to a 3×3 grid with a visible style and width. Chromium returns identical row and column lists, and pixels confirm a red first and blue second separator in both directions.
Grammar: <'column-rule-color'>.
Color paints no line with row-rule-style:none; a visible style and nonzero width are required. Lists and repeat() repeat a pattern, but alignment of multiple repeaters affects serialization. This CSS Gaps Editor’s Draft feature needs @supports and must not convey meaning alone.
Examples
<!doctype html><meta charset="utf-8"><style>html,body{margin:0;background:white}#grid{display:grid;grid-template:20px 20px 20px/20px 20px 20px;gap:20px;width:100px;rule-width:4px;rule-style:solid;rule-color:red,blue}</style><div id="grid"><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i></div><pre id="result"></pre><script>const s=getComputedStyle(grid),v='rgb(255, 0, 0), rgb(0, 0, 255)';if(s.ruleColor!==v||s.rowRuleColor!==v||s.columnRuleColor!==v)throw new Error('color mismatch');result.textContent='rule='+s.ruleColor+'; row='+s.rowRuleColor+'; column='+s.columnRuleColor;</script>Result
rule=rgb(255, 0, 0), rgb(0, 0, 255); row=rgb(255, 0, 0), rgb(0, 0, 255); column=rgb(255, 0, 0), rgb(0, 0, 255)
The example applies `rule-color:red,blue` to a 3×3 grid with a visible style and width. Chromium returns identical row and column lists, and pixels confirm a red first and blue second separator in both directions.