forked from turbine-kreuzberg/media-queries
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsix-breakpoints-revised.htm
More file actions
371 lines (322 loc) · 12.5 KB
/
six-breakpoints-revised.htm
File metadata and controls
371 lines (322 loc) · 12.5 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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.5, user-scalable=1">
<title>Six CSS media query breakpoints</title>
<style>
html {
/* The basic grid size for small devices */
font-size: 9.333333333px;
}
@media all {
/* Increase basic grid size for medium screens) and (larger */
html {
font-size: 10.666666667px;
}
}
body {
margin: 0;
color: #555;
background-color: #fff;
font-family: Frutiger, "Frutiger Linotype", Univers, Calibri, "Gill Sans", "Gill Sans MT", "Myriad Pro", Myriad, "DejaVu Sans Condensed", "Liberation Sans", "Nimbus Sans L", Tahoma, Geneva, "Helvetica Neue", Helvetica, Arial, sans-serif;
/**
* This is the basic font-size, given as a multiplier of the basic grid size.
* The basic grid size is also set as font-size, but on the HTML element
*) and (is just used as a pixel-refrence for the unit "rem" (root em).
* Thus, the default font-size is
* 1.5 * 9.333333333px = 13.999999999px
* The basic grid size on the HTML element is increased for medium) and (large screens.
* That bigger font-size is:
* 1.5 * 10.666666667px = 16px.
*/
font-size: 1.5rem;
/**
* The line height is a multiplier for the computed font-size.
* For example: 1.330357143 * 16px = 21.285714288px
*/
line-height: 1.330357143;
}
/**
* Headline-) and (special font-sizes as multiplicators to the basic grid size.
*/
.alpha { /* super-big teaser text */
font-size: 2.9325009000959996rem;
}
.beta { /* H1 */
font-size: 2.3452502399999995rem;
}
.gamma { /* H2 */
font-size: 1.8756rem;
}
.delta { /* H3 */
font-size: 1.5rem;
}
.epsilon { /* H4 */
font-size: 1.199616122840691rem;
}
.zeta { /* small print) and (notes */
font-size: 0.9593858947862213rem;
}
#width-display {
width: 100%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
border-top: 1px solid #aaa;
border-collapse: collapse;
text-align: center;
}
#width-display tr :first-child {
width: 20%;
}
#width-display td {
border: 1px solid #aaa;
}
/**
* Test output for this template file.
*/
.breakpoint-overview {
margin: 0;
padding: 0;
width: 100%;
list-style: none;
overflow: hidden;
}
.breakpoint-overview li {
float: left;
width: 16.66666666%;
height: 10em;
height: 50vh;
padding-top: 4em;
padding-top: 23vh;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
text-align: center;
font-size: 2.3452502399999995rem; /* H1 size */
color: #fff;
}
/**
* CSS Breakpoints
*
* There are two media-query definitions each breakpoint – one that may be
* inherited from) and (the other for that current breakpoint only.
* For example, a CSS property defined in @screen-sm will be visible on
* small screens) and (anything bigger (thus also at @screen-md) and @(screen-lg).
* A CSS property defined in @screen-sm-only should be visible only for this
* specific screen size.
*
* XXS: Extra extra small screen / smartphones portrait
* XS: Extra small screen / smartphones landscape
* SM: Small screen / tablet portrait
* MD: Medium screen / tablet landscape, laptop, small desktop
* LG: Large screen / desktop
* XL: Extra large screen / wide desktop
*
* @author Thomas Heuer <thomas.heuer@votum.de>
*/
/* @screen-xxs: */
@media all {
.breakpoint-overview li.xxs {
background-color: #ffdc00;
}
}
/* @screen-xxs-only: */
@media (max-width: 499px) and (orientation : portrait) {
.breakpoint-overview li.xxs-only {
background-color: #ffdc00;
}
}
/* @screen-xs: */
@media (min-width: 500px),
(min-width: 320px) and (orientation : landscape) {
.breakpoint-overview li.xs {
background-color: #ff851b;
}
}
/* @screen-xs-only: */
@media (min-width: 500px) and (max-width: 719px),
(min-width: 320px) and (max-width: 500px) and (orientation : landscape) {
.breakpoint-overview li.xs-only {
background-color: #ff851b;
}
}
/* @screen-sm: */
@media (min-width: 720px) {
.breakpoint-overview li.sm {
background-color: #85144b;
}
}
/* @screen-sm-only: */
@media (min-width: 720px) and (max-width: 1023px) {
.breakpoint-overview li.sm-only {
background-color: #85144b;
}
}
/* @screen-md: */
/* The height is necessary to match the MS Surface Tablets which have a huge width but a small height. */
@media (min-width: 1024px),
(min-width: 1300px) and (orientation : landscape) and (max-height: 768px) {
.breakpoint-overview li.md {
background-color: #b10dc9;
}
}
/* @screen-md-only: */
@media (min-width: 1024px) and (max-width: 1299px),
(min-width: 1300px) and (max-width: 1599px) and (orientation : landscape) and (max-height: 768px) {
.breakpoint-overview li.md-only {
background-color: #b10dc9;
}
}
/* @screen-lg: */
/* The height is necessary to match the MS Surface Tablets which have a huge width but a small height. */
@media (min-width: 1300px) and (min-height: 800px) {
.breakpoint-overview li.lg {
background-color: #0074d9;
}
}
/* @screen-lg-only: */
@media (min-width: 1300px) and (min-height: 800px) and (max-width: 1599px) {
.breakpoint-overview li.lg-only {
background-color: #0074d9;
}
}
/* @screen-xl: */
@media (min-width: 1600px) {
.breakpoint-overview li.xl,
/* @screen-xl-only = @screen-xl since this is the biggest breakpoint */
.breakpoint-overview li.xl-only {
background-color: #3d9970;
}
}
/* Test control output */
body:before, body:after {
content: '';
position: absolute;
top: 0;
padding: 0 1em;
color: #ccc;
background: #333;
line-height: 2em;
}
/* device-pixel media queries */
@media (-webkit-min-device-pixel-ratio: 1.0) {
body:after {
content: 'min-device-pixel-ratio: 1.0';
right: 0;
}
}
@media (-webkit-min-device-pixel-ratio: 1.3) {
body:after {
content: 'min-device-pixel-ratio: 1.3';
}
}
@media (-webkit-min-device-pixel-ratio: 1.5) {
body:after {
content: 'min-device-pixel-ratio: 1.5';
}
}
@media (-webkit-min-device-pixel-ratio: 2.0) {
body:after {
content: 'min-device-pixel-ratio: 2.0';
}
}
@media (-webkit-min-device-pixel-ratio: 3.0) {
body:after {
content: 'min-device-pixel-ratio: 3.0';
}
}
/* resolution mdeia queries */
@media (min-resolution: 96dpi) {
body:before {
content: 'min-dpi: 96dpi';
left: 0;
}
}
@media (min-resolution: 124dpi) {
body:before {
content: 'min-dpi: 124dpi';
}
}
@media (min-resolution: 144dpi) {
body:before {
content: 'min-dpi: 144dpi';
}
}
@media (min-resolution: 192dpi) {
body:before {
content: 'min-dpi: 192dpi';
}
}
@media (min-resolution: 288dpi) {
body:before {
content: 'min-dpi: 288dpi';
}
}
</style>
</head>
<body>
<ul class="breakpoint-overview">
<li class="xxs">XXS</li>
<li class="xs">XS</li>
<li class="sm">SM</li>
<li class="md">MD</li>
<li class="lg">LG</li>
<li class="xl">XL</li>
</ul>
<ul class="breakpoint-overview">
<li class="xxs-only">XXS only</li>
<li class="xs-only">XS only</li>
<li class="sm-only">SM only</li>
<li class="md-only">MD only</li>
<li class="lg-only">LG only</li>
<li class="xl-only">XL only</li>
</ul>
<table id="width-display">
<tr>
<th> </th>
<th>width</th>
<th>height</th>
</tr>
<tr>
<th>screen</th>
<td id="screen-width"></td>
<td id="screen-height"></td>
</tr>
<tr>
<th>window outer</th>
<td id="window-outer-width"></td>
<td id="window-outer-height"></td>
</tr>
<tr>
<th>window inner</th>
<td id="window-inner-width"></td>
<td id="window-inner-height"></td>
</tr>
<tr>
<th>document</th>
<td id="document-width"></td>
<td id="document-height"></td>
</tr>
</table>
<script>
(function() {
var displayWidth = function() {
document.getElementById( 'screen-width' ).innerText = screen.width;
document.getElementById( 'screen-height' ).innerText = screen.height;
document.getElementById( 'window-outer-width' ).innerText = window.outerWidth;
document.getElementById( 'window-outer-height' ).innerText = window.outerHeight;
document.getElementById( 'window-inner-width' ).innerText = window.innerWidth;
document.getElementById( 'window-inner-height' ).innerText = window.innerHeight;
document.getElementById( 'document-width' ).innerText = document.documentElement.clientWidth;
document.getElementById( 'document-height' ).innerText = document.documentElement.clientHeight;
};
displayWidth();
document.addEventListener( 'resize', function() {
displayWidth();
}, false );
})();
</script>
</body>
</html>