Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

  • This WPT test may be referenced by the following Test IDs:
<!DOCTYPE HTML>
<html><head>
<meta charset="utf-8">
<title>CSS Grid Lanes Test: nested empty row-direction subgrid propagates parent gutter delta</title>
<link rel="author" title="Alison Maher" href="mailto:almaher@microsoft.com">
<link rel="match" href="row-subgrid-grid-gap-015-ref.html">
<style>
html,body { color:black; background-color:white; padding:0; margin:0; }
.grid-lanes {
display:inline-grid-lanes;
grid-template-rows:auto auto auto auto;
border:1px solid;
background:yellow;
}
.subgrid {
display:grid;
grid-template-rows:subgrid;
min-width:30px;
}
</style>
</head>
<body>
<!--
Each track ends up 95px wide. The nested subgrid spans 2 tracks and is
auto-placed, so its largest possible per-track contribution is broadcast
to every track of the grid-lanes container. For a span-2 auto-placed
subgrid that contribution is the max of its two edge contributions, where
each edge sums that side's accumulated margin with half of the propagated
row-gap delta. Here the start edge gives 10 (outer margin-left) +
50 (half of the 100 row-gap delta) = 60, and the end edge gives 45
(inner margin-right 20 + half of the outer 50 row-gap) +
50 = 95. The end edge wins, so every track grows to 95px.
-->
<div class="grid-lanes">
<div class="subgrid" style="margin-top: 10px; row-gap:50px; grid-row:span 3; background:cyan;">
<div class="subgrid" style="margin-bottom: 20px;row-gap:100px;grid-row:span 2; background:magenta;"></div>
</div>
</div>
</body>
</html>