File: masonry-align-tracks-multi-001-ref.html

package info (click to toggle)
thunderbird 1%3A91.12.0-1~deb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 3,008,300 kB
  • sloc: cpp: 6,084,052; javascript: 4,790,441; ansic: 3,341,486; python: 862,958; asm: 366,542; xml: 204,277; java: 152,477; sh: 111,376; makefile: 21,388; perl: 15,312; yacc: 4,583; objc: 3,026; lex: 1,720; exp: 762; pascal: 635; awk: 564; sql: 453; php: 436; lisp: 432; ruby: 99; sed: 69; csh: 45
file content (116 lines) | stat: -rw-r--r-- 3,253 bytes parent folder | download | duplicates (8)
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<!DOCTYPE HTML>
<!--
     Any copyright is dedicated to the Public Domain.
     http://creativecommons.org/publicdomain/zero/1.0/
-->
<html><head>
  <meta charset="utf-8">
  <title>Reference: Masonry layout with multiple `align-tracks` values</title>
  <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com">
<style>
html,body {
  color:black; background-color:white; font:15px/1 monospace; padding:0; margin:0;
}
grid {
  display: inline-grid;
  grid-template-rows: auto;
  grid-template-columns: repeat(8,50px); /*intentionally one more than align-tracks values*/
  gap: 3px 5px;
  padding: 10px 3px 1px 7px;
  border: solid;
  border-width: 1px 7px 3px 5px;
  background: lightgrey content-box;
  height: 500px;
  vertical-align: top;
}
.fallback { grid-template-columns:3px; padding:0; border:0; }
item {
  background: grey;
  height: 2em;
  position: relative;
  border: 1px solid;
}
.purple { background:purple; height:auto; border-top:3px solid; }
z { display: block; background: yellow; height: 0; width:80%; }
a {
 position: absolute;
 inset: 0;
 top: auto;
 border: 2px solid lime;
}
masonry-track {
  display: grid;
  gap: 3px 5px;
}
masonry-track:nth-child(1) { align-content:start }
masonry-track:nth-child(2) { align-content:end }
masonry-track:nth-child(3) { align-content:center }
masonry-track:nth-child(4) { align-content:stretch; grid-template-rows: auto auto repeat(3,max-content) }
masonry-track:nth-child(5) { align-content:space-between }
masonry-track:nth-child(6) { align-content:space-around }
masonry-track:nth-child(7) { align-content:space-evenly }
masonry-track:nth-child(8) { align-content:space-evenly }
</style>
</head>
<body>
<grid>
 <masonry-track>
  <item style="width:25px">1</item>
  <item>11</item>
  <item class="purple">20</item>
  <item class="purple">24</item>
  <item>29</item>
 </masonry-track>
 <masonry-track>
  <item class="purple" style="height:50px">2</item>
  <item class="purple" style="writing-mode:vertical-rl">16 vertical-rl</item>
 </masonry-track>
 <masonry-track>
  <item style="margin-left:5px">3</item>
  <item class="purple">12<z></z></item>
  <item>17</item>
  <item>25</item>
  <item>33</item>
 </masonry-track>
 <masonry-track>
  <item class="purple" style="margin-top:5px">4</item>
  <item class="purple">10</item>
  <item>15</item>
  <item>23</item>
  <item>31</item>
 </masonry-track>
 <masonry-track>
  <item>5</item>
  <item>13</item>
  <item>21</item>
  <item class="purple">28</item>
 </masonry-track>
 <masonry-track>
  <item class="purple">6<a></a></item>
  <item>9<a></a></item>
  <item class="purple">18</item>
  <item class="purple">22</item>
  <item>27</item>
 </masonry-track>
 <masonry-track>
  <item>7</item>
  <item class="purple">14<z></z><a></a></item>
  <item>19</item>
  <item class="purple">26</item>
  <item class="purple">30</item>
 </masonry-track>
 <masonry-track>
  <item class="purple" style="writing-mode:vertical-lr">8 vertical-lr</item>
  <item class="purple">32</item>
 </masonry-track>
</grid>
<grid class="fallback" style="align-content:start">
  <item></item>
</grid>
<grid class="fallback" style="align-content:center">
  <item></item>
</grid>
<grid class="fallback" style="align-content:center">
  <item></item>
</grid>
</body></html>