-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathindex.html
130 lines (112 loc) · 5.57 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, height=device-height" />
<title>viewports.scss live demo</title>
<link rel="stylesheet" type="text/css" href="index.css" />
</head>
<body>
<h1>viewports.scss</h1>
<p>
The current viewport is considered "<span class="current-range-name emphasized"></span>".
Below, you can see which viewport ranges have been configured (you can totally change them)
and how they match up with specific viewport widths:
</p>
<div class="range-cursor"><div></div></div>
<ul class="range-scale with-range-names with-pixel-counts">
<!-- prepare for at most 10 defined ranges: -->
<li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li>
</ul>
<p class="emphasized">
<span class="instruction-downsize">Make your browser window smaller</span>
<span class="instruction-resize">Resize your browser</span>
to see how matches change.
</p>
<h2>Query types</h2>
<p>
The samples below demonstrate to which named ranges your styles
would apply, should you use <code>@include viewports()</code> with specific arguments.
</p>
<p><code>@include viewports(<span class="current-range-name"></span>)</code> will apply to ranges:</p>
<ul class="range-scale with-range-names with-current-highlighted">
<!-- prepare for at most 10 defined ranges: -->
<li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li>
</ul>
<ul class="match-list">
<li class="query-among"></li>
</ul>
<p><code>@include viewports(<span class="emphasized">below</span> <span class="current-range-name"></span>)</code> will apply to ranges:</p>
<ul class="range-scale with-range-names with-current-highlighted">
<!-- prepare for at most 10 defined ranges: -->
<li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li>
</ul>
<ul class="match-list">
<li class="query-below"></li>
</ul>
<p><code>@include viewports(<span class="emphasized">up-to</span> <span class="current-range-name"></span>)</code> will apply to ranges:</p>
<ul class="range-scale with-range-names with-current-highlighted">
<!-- prepare for at most 10 defined ranges: -->
<li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li>
</ul>
<ul class="match-list">
<li class="query-up-to"></li>
</ul>
<p><code>@include viewports(<span class="emphasized">up-from</span> <span class="current-range-name"></span>)</code> will apply to ranges:</p>
<ul class="range-scale with-range-names with-current-highlighted">
<!-- prepare for at most 10 defined ranges: -->
<li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li>
</ul>
<ul class="match-list">
<li class="query-up-from"></li>
</ul>
<p><code>@include viewports(<span class="emphasized">above</span> <span class="current-range-name"></span>)</code> will apply to ranges:</p>
<ul class="range-scale with-range-names with-current-highlighted">
<!-- prepare for at most 10 defined ranges: -->
<li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li>
</ul>
<ul class="match-list">
<li class="query-above"></li>
</ul>
<p><code>@include viewports(<span class="emphasized">'not'</span> <span class="current-range-name"></span>)</code> will apply to ranges:</p>
<ul class="range-scale with-range-names with-current-highlighted">
<!-- prepare for at most 10 defined ranges: -->
<li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li>
</ul>
<ul class="match-list">
<!-- prepare for at most 5 matched ranges: -->
<li class="query-not"></li>
<li class="query-not"></li>
<li class="query-not"></li>
<li class="query-not"></li>
<li class="query-not"></li>
</ul>
<p>Note that since "not" is a reserved word in SASS, in this case the operator needs to be quoted. Sorry about that.</p>
<div class="debug-info-explanation">
Set <code>$VIEWPORTS_DEBUG: true;</code> in your project,
and you'll get this to help with picking your breakpoints!
It's completely CSS-generated, so no JS needed.
</div>
<script>
(function() {
var $widthCursor = window.document.querySelector('.range-cursor > div');
function updateCurrentWidth() {
$widthCursor.innerHTML = window.innerWidth + 'px';
}
window.onresize = updateCurrentWidth;
updateCurrentWidth();
})();
</script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-42176157-2']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<a href="https://github.com/jareware/viewports"><img style="position: fixed; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png" alt="Fork me on GitHub"></a>
</body>
</html>