Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-grid/subgrid/orthogonal-writing-mode-005.html - WPT Dashboard Interop Dashboard
<!DOCTYPE HTML>
<html><head>
<meta charset="utf-8">
<title>CSS Grid Test: line names in orthogonal parent subgrid</title>
<link rel="author" title="Kurt Catti-Schmidt" href="mailto:kschmi@microsoft.com">
<link rel="match" href="orthogonal-writing-mode-005-ref.html">
<style>
body {
color:black; background-color:white; font:10px monospace; padding:0; margin:0; line-height:0;
}
.grid {
display: inline-grid;
grid-auto-columns: 15px;
border: 1px solid;
vertical-align: bottom;
}
.subgrid {
display: grid;
grid-template-columns: subgrid;
grid-column: 3 / span 4;
background: grey;
}
.grid > .subgrid > .subgrid {
writing-mode: vertical-lr;
grid-template-rows: subgrid;
grid-template-columns: initial;
grid-column: 1 / span 4;
grid-auto-columns: 8px;
grid-auto-flow: column;
}
.fill-1a { grid-template-columns: subgrid repeat(auto-fill, [y]) [z] [z] [z] [z] } /* [y] [z] [z] [z] [z] */
.fill-1b { grid-template-columns: subgrid [x] repeat(auto-fill, [y]) [z] [z] [z] } /* [x] [y] [z] [z] [z] */
.fill-1c { grid-template-columns: subgrid [x] [x] repeat(auto-fill, [y]) [z] [z] } /* [x] [x] [y] [z] [z] */
.fill-1d { grid-template-columns: subgrid [x] [x] [x] repeat(auto-fill, [y]) [z] } /* [x] [x] [x] [y] [z] */
.fill-1e { grid-template-columns: subgrid [x] [x] [x] [x] repeat(auto-fill, [y]) } /* [x] [x] [x] [x] [y] */
.areas-1a { grid-template-areas: 'x x x x' }
.areas-1b { grid-template-areas: '. x x x' }
.areas-1c { grid-template-areas: 'x x x .' }
.areas-1d { grid-template-areas: '. . x x' }
.areas-1e { grid-template-areas: '. . x .' }
.subgrid > .subgrid > :nth-child(2n) { background: black; }
.subgrid > .subgrid > :nth-child(2n+1) { background: pink; }
.subgrid > .subgrid > * { writing-mode: horizontal-tb; }
</style>
</head>
<body>
<!-- Line names before auto repeat -->
<div class="grid"><div class="subgrid fill-1a"><div class="subgrid">
<div style="grid-row:z 5"></div>
<div style="grid-row:z 4"></div>
<div style="grid-row:z 3"></div>
<div style="grid-row:z 2"></div>
<div style="grid-row:z 1"></div>
<div style="grid-row:z -1"></div>
<div style="grid-row:z -2"></div>
<div style="grid-row:z -3"></div>
<div style="grid-row:z -4"></div>
<div style="grid-row:z -5"></div>
</div></div></div>
<div class="grid"><div class="subgrid fill-1b"><div class="subgrid">
<div style="grid-row:x 5"></div>
<div style="grid-row:x 4"></div>
<div style="grid-row:x 3"></div>
<div style="grid-row:x 2"></div>
<div style="grid-row:x 1"></div>
<div style="grid-row:x -1"></div>
<div style="grid-row:x -2"></div>
<div style="grid-row:x -3"></div>
<div style="grid-row:x -4"></div>
<div style="grid-row:x -5"></div>
</div></div></div>
<div class="grid"><div class="subgrid fill-1c"><div class="subgrid">
<div style="grid-row:x 5"></div>
<div style="grid-row:x 4"></div>
<div style="grid-row:x 3"></div>
<div style="grid-row:x 2"></div>
<div style="grid-row:x 1"></div>
<div style="grid-row:x -1"></div>
<div style="grid-row:x -2"></div>
<div style="grid-row:x -3"></div>
<div style="grid-row:x -4"></div>
<div style="grid-row:x -5"></div>
</div></div></div>
<div class="grid"><div class="subgrid fill-1d"><div class="subgrid">
<div style="grid-row:x 5"></div>
<div style="grid-row:x 4"></div>
<div style="grid-row:x 3"></div>
<div style="grid-row:x 2"></div>
<div style="grid-row:x 1"></div>
<div style="grid-row:x -1"></div>
<div style="grid-row:x -2"></div>
<div style="grid-row:x -3"></div>
<div style="grid-row:x -4"></div>
<div style="grid-row:x -5"></div>
</div></div></div>
<div class="grid"><div class="subgrid fill-1e"><div class="subgrid">
<div style="grid-row:x 5"></div>
<div style="grid-row:x 4"></div>
<div style="grid-row:x 3"></div>
<div style="grid-row:x 2"></div>
<div style="grid-row:x 1"></div>
<div style="grid-row:x -1"></div>
<div style="grid-row:x -2"></div>
<div style="grid-row:x -3"></div>
<div style="grid-row:x -4"></div>
<div style="grid-row:x -5"></div>
</div></div></div>
<div class="grid"><div class="subgrid fill-1a"><div class="subgrid">
<div style="grid-row:y 5"></div>
<div style="grid-row:y 4"></div>
<div style="grid-row:y 3"></div>
<div style="grid-row:y 2"></div>
<div style="grid-row:y 1"></div>
<div style="grid-row:y -1"></div>
<div style="grid-row:y -2"></div>
<div style="grid-row:y -3"></div>
<div style="grid-row:y -4"></div>
<div style="grid-row:y -5"></div>
</div></div></div>
<!-- Auto repeat line names -->
<div class="grid"><div class="subgrid fill-1b"><div class="subgrid">
<div style="grid-row:y 5"></div>
<div style="grid-row:y 4"></div>
<div style="grid-row:y 3"></div>
<div style="grid-row:y 2"></div>
<div style="grid-row:y 1"></div>
<div style="grid-row:y -1"></div>
<div style="grid-row:y -2"></div>
<div style="grid-row:y -3"></div>
<div style="grid-row:y -4"></div>
<div style="grid-row:y -5"></div>
</div></div></div>
<div class="grid"><div class="subgrid fill-1c"><div class="subgrid">
<div style="grid-row:y 5"></div>
<div style="grid-row:y 4"></div>
<div style="grid-row:y 3"></div>
<div style="grid-row:y 2"></div>
<div style="grid-row:y 1"></div>
<div style="grid-row:y -1"></div>
<div style="grid-row:y -2"></div>
<div style="grid-row:y -3"></div>
<div style="grid-row:y -4"></div>
<div style="grid-row:y -5"></div>
</div></div></div>
<div class="grid"><div class="subgrid fill-1d"><div class="subgrid">
<div style="grid-row:y 5"></div>
<div style="grid-row:y 4"></div>
<div style="grid-row:y 3"></div>
<div style="grid-row:y 2"></div>
<div style="grid-row:y 1"></div>
<div style="grid-row:y -1"></div>
<div style="grid-row:y -2"></div>
<div style="grid-row:y -3"></div>
<div style="grid-row:y -4"></div>
<div style="grid-row:y -5"></div>
</div></div></div>
<div class="grid"><div class="subgrid fill-1e"><div class="subgrid">
<div style="grid-row:y 5"></div>
<div style="grid-row:y 4"></div>
<div style="grid-row:y 3"></div>
<div style="grid-row:y 2"></div>
<div style="grid-row:y 1"></div>
<div style="grid-row:y -1"></div>
<div style="grid-row:y -2"></div>
<div style="grid-row:y -3"></div>
<div style="grid-row:y -4"></div>
<div style="grid-row:y -5"></div>
</div></div></div>
<div class="grid"><div class="subgrid fill-1a"><div class="subgrid">
<div style="grid-row:z 5"></div>
<div style="grid-row:z 4"></div>
<div style="grid-row:z 3"></div>
<div style="grid-row:z 2"></div>
<div style="grid-row:z 1"></div>
<div style="grid-row:z -1"></div>
<div style="grid-row:z -2"></div>
<div style="grid-row:z -3"></div>
<div style="grid-row:z -4"></div>
<div style="grid-row:z -5"></div>
</div></div></div>
<div class="grid"><div class="subgrid fill-1b"><div class="subgrid">
<div style="grid-row:z 5"></div>
<div style="grid-row:z 4"></div>
<div style="grid-row:z 3"></div>
<div style="grid-row:z 2"></div>
<div style="grid-row:z 1"></div>
<div style="grid-row:z -1"></div>
<div style="grid-row:z -2"></div>
<div style="grid-row:z -3"></div>
<div style="grid-row:z -4"></div>
<div style="grid-row:z -5"></div>
</div></div></div>
<div class="grid"><div class="subgrid fill-1c"><div class="subgrid">
<div style="grid-row:z 5"></div>
<div style="grid-row:z 4"></div>
<div style="grid-row:z 3"></div>
<div style="grid-row:z 2"></div>
<div style="grid-row:z 1"></div>
<div style="grid-row:z -1"></div>
<div style="grid-row:z -2"></div>
<div style="grid-row:z -3"></div>
<div style="grid-row:z -4"></div>
<div style="grid-row:z -5"></div>
</div></div></div>
<div class="grid"><div class="subgrid fill-1d"><div class="subgrid">
<div style="grid-row:z 5"></div>
<div style="grid-row:z 4"></div>
<div style="grid-row:z 3"></div>
<div style="grid-row:z 2"></div>
<div style="grid-row:z 1"></div>
<div style="grid-row:z -1"></div>
<div style="grid-row:z -2"></div>
<div style="grid-row:z -3"></div>
<div style="grid-row:z -4"></div>
<div style="grid-row:z -5"></div>
</div></div></div>
<div class="grid"><div class="subgrid fill-1e"><div class="subgrid">
<div style="grid-row:z 5"></div>
<div style="grid-row:z 4"></div>
<div style="grid-row:z 3"></div>
<div style="grid-row:z 2"></div>
<div style="grid-row:z 1"></div>
<div style="grid-row:z -1"></div>
<div style="grid-row:z -2"></div>
<div style="grid-row:z -3"></div>
<div style="grid-row:z -4"></div>
<div style="grid-row:z -5"></div>
</div></div></div>
<!-- Named grid areas -->
<div class="grid"><div class="subgrid areas-1a"><div class="subgrid">
<div style="grid-row:x-start"></div>
<div style="grid-row:x"></div>
<div style="grid-row:x-start / x-end"></div>
<div style="grid-row:x-end"></div>
</div></div></div>
<div class="grid"><div class="subgrid areas-1b"><div class="subgrid">
<div style="grid-row:x-start"></div>
<div style="grid-row:x"></div>
<div style="grid-row:x-start / x-end"></div>
<div style="grid-row:x-end"></div>
</div></div></div>
<div class="grid"><div class="subgrid areas-1c"><div class="subgrid">
<div style="grid-row:x-start"></div>
<div style="grid-row:x"></div>
<div style="grid-row:x-start / x-end"></div>
<div style="grid-row:x-end"></div>
</div></div></div>
<div class="grid"><div class="subgrid areas-1d"><div class="subgrid">
<div style="grid-row:x-start"></div>
<div style="grid-row:x"></div>
<div style="grid-row:x-start / x-end"></div>
<div style="grid-row:x-end"></div>
</div></div></div>
<div class="grid"><div class="subgrid areas-1e"><div class="subgrid">
<div style="grid-row:x-start"></div>
<div style="grid-row:x"></div>
<div style="grid-row:x-start / x-end"></div>
<div style="grid-row:x-end"></div>
</div></div></div>
</body>
</html>