Base: Add more tests for display: grid

This commit is contained in:
martinfalisse 2022-09-07 14:52:13 +02:00 committed by Andreas Kling
parent 1ea90e340c
commit ca3d479f6f
Notes: sideshowbarker 2024-07-17 08:35:21 +09:00

View File

@ -29,3 +29,58 @@
<div class="grid-item">3</div>
<div class="grid-item">4</div>
</div>
<!-- Check for a bug where a github page was crashing due to the following code. -->
<p>If you can see this message then the test passed.</p>
<div
class="grid-container"
style="
--Layout-sidebar-width:296px;
grid-template-columns: minmax(0, var(--Layout-sidebar-width));">
<div class="grid-item">1</div>
</div>
<!-- Using grid-row and grid-column -->
<p>Should render a full-width 4x4 grid with:
<ul>
<li>one large column on the left</li>
<li>one large column on the right, being split in half vertically, with the number 2 in the top half, and numbers 3, 4, 5, and 6 in the bottom</li>
</ul>
<div
class="grid-container"
style="
grid-template-columns: 1fr 1fr 1fr 1fr;
grid-template-rows: 50px 50px 50px 50px;
">
<div class="grid-item" style="grid-row: 1/-1; grid-column: 1/3;">1</div>
<div class="grid-item" style="grid-row: 1/3; grid-column: 3/-1;">2</div>
<div class="grid-item">3</div>
<div class="grid-item">4</div>
<div class="grid-item">5</div>
<div class="grid-item">6</div>
</div>
<!-- Different column sizes -->
<p>Should render a 2x2 grid with columns 50px and 50%</p>
<div
class="grid-container"
style="
grid-template-columns: 50px 50%;
grid-template-rows: auto auto;">
<div class="grid-item"
style="
grid-column: 1 / 1;
grid-row: 1 / 1">1</div>
<div class="grid-item"
style="
grid-column: 2 / 2;
grid-row: 1 / 1">2</div>
<div class="grid-item"
style="
grid-column: 1 / 1;
grid-row: 2 / 2">3</div>
<div class="grid-item"
style="
grid-column: 2 / 2;
grid-row: 2 / 2">4</div>
</div>