-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathflex-flow-stacking-col.html
More file actions
executable file
·193 lines (186 loc) · 4.64 KB
/
flex-flow-stacking-col.html
File metadata and controls
executable file
·193 lines (186 loc) · 4.64 KB
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<!doctype html>
<html class="code">
<head>
<meta charset="utf-8"/>
<title>Stacking of column-oriented flex lines</title>
<link rel="stylesheet" href="c/examples.css"/>
<style contenteditable>
body {
text-align: center;
padding: 3em 6em;
font-family: Open Sans, sans-serif;
font-size:25px;
}
article {
width: 24em;
}
article + article {
margin-top: 4em;
}
section {
display: flex;
align-items: flex-start;
align-content: flex-start;
gap: 0.5em;
position: relative;
border: 1px dashed;
padding: 10px;
background: #EEE;
width: 27em; height: 11em;
}
section > span {
border: 1px solid;
margin-block: 0.25em;
margin-inline: 0.25em;
padding: 0.5em;
background-color: rgba(0, 0, 0, 0.1);
}
section > div {
position: absolute; top: -1.2em; left: -5em;
display: flex; justify-content: space-between;
}
section > div span {
margin: 0 0.33em;
}
section > div.cross {
flex-direction: row-reverse;
color: red;
right: -1px;
left: -5.5em;
padding-bottom: 1.1em;
background: url(i/arrow-left.svg) 0 50% / 0.33em 0.75em no-repeat,
linear-gradient(to left,red,red) 50% 50% / 100% 3px no-repeat,
linear-gradient(to left,red,red) 100% 50% / 3px 2ch no-repeat;
}
section > div.cross .end {
margin-left: 0.5em;
translate: 0 1.25em;
}
section > div.main {
flex-direction: column-reverse;
color: blue;
top: -2.4em;
bottom: -1px;
width: 10em;
align-items: flex-start;
background: url(i/arrow-down.svg) 50% 100% / 0.75em 0.33em no-repeat,
linear-gradient(to top,blue,blue) 50% 50% / 3px 100% no-repeat,
linear-gradient(to top,blue,blue) 50% 0% / 2ch 3px no-repeat;
}
section[style*="column-reverse"] > div.main {
background: url(i/arrow-up.svg) 50% 0 / 0.75em 0.33em no-repeat,
linear-gradient(to top,blue,blue) 50% 50% / 3px 100% no-repeat,
linear-gradient(to top,blue,blue) 50% 100% / 2ch 3px no-repeat;
}
section > div.main .end {
align-self: flex-end; margin-top: 0.5em;
}
.start, .end {
font: 1em Helvetica, sans-serif;
}
section > div.lines {
color: green;
flex-direction: row-reverse;
gap: 1px;
top: 0;
left: auto;
right: 0.25em;
height: 100%;
align-items: stretch;
}
section > div.lines span {
display: flex;
align-items: end;
justify-content: center;
margin: 0;
padding-inline: 6px;
padding-block: 0.25em;
border-inline: 2px dashed;
font-size: 1rem;
background: url(i/arrow-left-green.svg), url(i/arrow-right-green.svg), linear-gradient(green, green);
background-repeat: no-repeat;
background-size: 7px 11px, 7px 11px, 100% 2px;
background-position: 0 calc(100% - 0.25em - 5px), 100% calc(100% - 0.25em - 5px), 50% calc(100% - 0.85em);
}
section > div.lines span b {
background: #EEE;
padding-inline: 0.25ch;
}
section[style*="column-reverse"] > div.lines span {
align-items: start;
background-position: 0 calc(1em - 5px), 100% calc(1em - 5px), 50% 1em;
}
section > div.lines span:nth-of-type(1) {width: 120px;}
section > div.lines span:nth-of-type(2) {width: 108px;}
section > div.lines span:nth-of-type(3) {width: 108px;}
section > div.lines span:nth-of-type(4) {width: 92px;}
section > div.lines span:nth-of-type(5) {width: 70px;}
section + p {
margin-top: 0.25em;
font-family: Consolas, monospace;
}
</style>
</head>
<body>
<article>
<section style="flex-flow: wrap-reverse column">
<span>A</span>
<span>Banana</span>
<span>CCC</span>
<span>DDDD</span>
<span>EEE<br>EE</span>
<span>FFF<br>FFF</span>
<span>GGGG<br>GGGG</span>
<span>HHH<br>HHH<br>HHH</span>
<span>IIIII<br>IIIII</span>
<span>JJJJJ<br>JJJ<br>JJJJJ</span>
<div class="main">
<span class="start">Main-end</span>
<span class="end">Main-start</span>
</div>
<div class="cross">
<span class="start">Cross-start</span>
<span class="end">Cross-end</span>
</div>
<div class="lines">
<span><b>Line #1</b></span>
<span><b>Line #2</b></span>
<span><b>Line #3</b></span>
<span><b>Line #4</b></span>
<span><b>Line #5</b></span>
</div>
</section>
<p>flex-flow: wrap-reverse column</p>
</article>
<article>
<section style="flex-flow: wrap-reverse column-reverse">
<span>A</span>
<span>Banana</span>
<span>CCC</span>
<span>DDDD</span>
<span>EEE<br>EE</span>
<span>FFF<br>FFF</span>
<span>GGGG<br>GGGG</span>
<span>HHH<br>HHH<br>HHH</span>
<span>IIIII<br>IIIII</span>
<span>JJJJJ<br>JJJ<br>JJJJJ</span>
<div class="main">
<span class="start">Main-start</span>
<span class="end">Main-end</span>
</div>
<div class="cross">
<span class="start">Cross-start</span>
<span class="end">Cross-end</span>
</div>
<div class="lines">
<span><b>120 px</b></span>
<span><b>108 px</b></span>
<span><b>108 px</b></span>
<span><b>92 px</b></span>
<span><b>70 px</b></span>
</div>
</section>
<p>flex-flow: wrap-reverse column-reverse</p>
</article>
</body>
</html>