Source code

Revision control

Copy as Markdown

Other Tools

<!DOCTYPE HTML>
<!--
Any copyright is dedicated to the Public Domain.
-->
<html>
<head>
<meta charset="utf-8">
<title>Verify correct sizing of intrinsically sized tracks when using subgrid in CSS Masonry</title>
<link rel="author" title="Brandon Stewart" href="mailto:brandonstewart@apple.com">
<style>
grid {
display: inline-grid;
grid-template-columns: auto min-content max-content;
border: 1px solid;
background: lightgrey;
}
subgrid {
display: grid;
grid: subgrid / subgrid;
grid-column: 2 / span 2;
grid-row: 1 / span 2;
background: lightblue;
}
</style>
</head>
<body>
<grid>
<item>1</item>
<subgrid>
<item>2</item>
<item>3</item>
<item>4</item>
</subgrid>
<item>5</item>
</grid>
<grid>
<item style="width: 2ch">1</item>
<subgrid>
<item style="width: 2ch">2</item>
<item style="width: 2ch">3</item>
<item>4</item>
</subgrid>
<item>5</item>
</grid>
<grid>
<item>1</item>
<subgrid>
<item style="width: 3ch">2</item>
<item style="width: 3ch">3</item>
<item>4</item>
</subgrid>
<item>5</item>
</grid>
<grid>
<item style="width: 4ch">1</item>
<subgrid>
<item>2</item>
<item style="width: 4ch">3</item>
<item style="width: 4ch">4</item>
</subgrid>
<item>5</item>
</grid>
<grid>
<item style="width: 3ch">1</item>
<subgrid>
<item style="width: 3ch">2</item>
<item style="width: 3ch">3</item>
<item>4</item>
</subgrid>
<item>5</item>
</grid>
</body>
</html>