forked from uikit/uikit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
height.html
103 lines (82 loc) · 4.15 KB
/
height.html
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
<!DOCTYPE html>
<html lang="en-gb" dir="ltr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Height - UIkit tests</title>
<script src="js/test.js"></script>
<style type="text/css">
[uk-height-match] > * > .uk-panel {
padding: 10px;
text-align: center;
}
[uk-height-match] > :nth-child(10n-9) > .uk-panel { background: rgba(0,0,0,0.1); }
[uk-height-match] > :nth-child(10n-8) > .uk-panel { background: rgba(0,0,0,0.15); }
[uk-height-match] > :nth-child(10n-7) > .uk-panel { background: rgba(0,0,0,0.2); }
[uk-height-match] > :nth-child(10n-6) > .uk-panel { background: rgba(0,0,0,0.25); }
[uk-height-match] > :nth-child(10n-5) > .uk-panel { background: rgba(0,0,0,0.3); }
[uk-height-match] > :nth-child(10n-4) > .uk-panel { background: rgba(0,0,0,0.35); }
[uk-height-match] > :nth-child(10n-3) > .uk-panel { background: rgba(0,0,0,0.40); }
[uk-height-match] > :nth-child(10n-2) > .uk-panel { background: rgba(0,0,0,0.45); }
[uk-height-match] > :nth-child(10n-1) > .uk-panel { background: rgba(0,0,0,0.50); }
[uk-height-match] > :nth-child(10n) > .uk-panel { background: rgba(0,0,0,0.55); }
</style>
</head>
<body>
<div class="uk-container">
<h2>Height Match</h2>
<div class="uk-grid uk-child-width-1-2@s">
<div>
<h3>Each Row</h3>
<div class="uk-child-width-1-2@m" uk-grid uk-height-match="target: > div > .uk-panel">
<div><div class="uk-panel">1-2-M<br>...<br>...</div></div>
<div><div class="uk-panel">1-2-M</div></div>
<div><div class="uk-panel">1-2-M<br>...</div></div>
<div><div class="uk-panel">1-2-M</div></div>
</div>
</div>
<div>
<h3>All Rows</h3>
<div class="uk-child-width-1-2@m" uk-grid uk-height-match="target: > div > .uk-panel; row: false">
<div><div class="uk-panel">1-2-M<br>...<br>...</div></div>
<div><div class="uk-panel">1-2-M</div></div>
<div><div class="uk-panel">1-2-M<br>...</div></div>
<div><div class="uk-panel">1-2-M</div></div>
</div>
</div>
<div>
<h3>Hidden Panels</h3>
<div class="uk-child-width-1-2@m" uk-grid uk-height-match="target: > div > .uk-panel; row: false">
<div><div class="uk-panel" style="display: none;">1-2-M<br>...<br>...</div></div>
<div><div class="uk-panel">1-2-M<br>...</div></div>
</div>
</div>
</div>
<h2>JavaScript Options</h2>
<table class="uk-table uk-table-striped">
<thead>
<tr>
<th>Option</th>
<th>Value</th>
<th>Default</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>target</code></td>
<td>CSS selector</td>
<td><code>> *</code></td>
<td>Elements that should match. By default the children will match.</td>
</tr>
<tr>
<td><code>row</code></td>
<td>Boolean</td>
<td><code>true</code></td>
<td>By default only items in the same row will be matched. For example, once grid columns extend to a width of 100%, their heights will no longer be matched. This makes sense, for example, if they stack vertically in narrower viewports.</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>