CKTIS / CSS
rule-inset — offsetting gap-rule endpoints
The rule-inset shorthand adjusts the endpoints of decorative rules in gaps between items. It changes neither item sizes nor gap sizes.
Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
Syntax
rule-inset: <inset-value> <inset-value>? [ / <inset-value> <inset-value>? ]?;
<inset-value> = <length-percentage> | overlap-joinrule-inset sets column-rule-inset and row-rule-inset together. Gap decorations separate items without adding borders to individual cells.
Value order is cap-start cap-end / junction-start junction-end: decoration caps, then junction endpoints. An omitted / section copies the first pair; an omitted end copies its start. Positive values shorten rules; negative values extend them. Percentages reference the crossing gap width, not the container. overlap-join joins decorations at junctions; at cap endpoints it acts as 0.
The example requires Grid gap-decoration support. Check syntax and appearance in the target browser. Accepting the declaration alone does not establish correct rendering.
Examples
<!doctype html>
<meta charset="utf-8">
<title>rule-inset</title>
<style>
.grid {
display: grid;
grid-template-columns: repeat(2, 80px);
grid-template-rows: repeat(2, 60px);
gap: 20px;
width: max-content;
column-rule: 2px solid navy;
row-rule: 2px solid navy;
rule-break: intersection;
rule-inset: 8px;
}
.grid > div { background: #eee; }
</style>
<div class="grid">
<div>A</div><div>B</div><div>C</div><div>D</div>
</div>Result
Expected with full support: a 180px × 140px grid containing four cells. Navy gap-rule segments are shortened by 8px at each end; cell sizes and gaps remain unchanged.
The check in an isolated environment covered this exact code and its stated expected result, but did not establish that the gap rules are painted as expected.