-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheight.html
160 lines (125 loc) · 6.1 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
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
<!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>
[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>
<h3>JavaScript Options</h3>
<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>> *</td>
<td>Elements that should match. By default, the children will match.</td>
</tr>
<tr>
<td><code>row</code></td>
<td>Boolean</td>
<td>true</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>
<h2>Height Placeholder</h2>
</div>
<div class="uk-position-relative uk-margin">
<div class="tm-header uk-position-top">
<nav class="uk-navbar-container uk-navbar-transparent" uk-inverse="sel-active: .uk-navbar-transparent">
<div class="uk-container">
<div uk-navbar>
<div class="uk-navbar-left">
<a class="uk-navbar-item uk-logo" href="#">Transparent Navbar</a>
</div>
</div>
</div>
</nav>
</div>
<div class="uk-section-muted">
<div uk-height-placeholder="!.uk-position-relative .tm-header"></div>
<div class="uk-section">
<div class="uk-container">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum.</p>
</div>
</div>
</div>
</div>
<div class="uk-container uk-margin">
<h3>JavaScript Options</h3>
<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></td>
<td>Element whose height will be used.</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>