summaryrefslogtreecommitdiff
path: root/Tests/LibWeb/Layout/input/grid/gap.html
blob: 9dd5f6f5fd33761e59b262593fba56d342cf710a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<style>
  body {
    font-family: 'SerenitySans';
  }

  .grid-container {
    display: grid;
    background-color: lightsalmon;
  }

  .grid-item {
    background-color: lightblue;
  }
</style>

<!-- There should be a large (50px) column gap and small (10px) row gap -->
<div class="grid-container" style="
    grid-template-columns: auto auto;
    gap: 10px 50px;
  ">
  <div class="grid-item">1</div>
  <div class="grid-item">2</div>
  <div class="grid-item">3</div>
  <div class="grid-item">4</div>
</div>

<!-- There should be a Z-shaped gap (with both vertical and horizontal gap) -->
<div class="grid-container" style="
    grid-template-columns: auto auto;
    gap: calc(1vh + 10px) calc(10% - 10px);
  ">
  <div class="grid-item" style="grid-column: 2 / span 1">1</div>
  <div class="grid-item">2</div>
</div>

<!-- Column-gaps with overflowing column spans -->
<!-- There should be 1 column that starts at column 2 and spans until the end. -->
<div class="grid-container" style="
        grid-column-gap: 16px;
        grid-template-columns: 1fr 1fr;
    ">
  <div class="grid-item" style="grid-column: 2 / span 5;">1</div>
</div>

<!-- Column-gaps with overflowing column spans and row spans -->
<!-- There should be 1 column that starts at column 2 and spans until the end. -->
<div class="grid-container" style="
        grid-column-gap: 16px;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 20px;
    ">
  <div class="grid-item" style="grid-column: 2 / span 5; grid-row: span 4">1</div>
</div>

<!-- Bug with column gaps - grid items should have normal height -->
<div class="grid-container with-border" style="
      grid-column-gap: 10px;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    ">
  <div class="grid-item with-border">left side text</div>
  <div class="grid-item with-border">right side text right side text right side text</div>
</div>