/
viewport.scss
71 lines (54 loc) · 1.95 KB
/
viewport.scss
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
$media-register : (
/* small smartphone landscape and portrait and both. */
'small-phone-lp' : 'only screen
and (min-width : 320px)',
'small-phone-l' : 'only screen
and (min-width : 321px)
and (orientation : landscape)',
'small-phone-p' : 'only screen
and (min-width : 320px)
and (orientation : portrait)',
/* large smartphone landscape and portrait and both. */
'large-phone-lp' : 'only screen
and (min-width : 480px)',
'large-phone-l' : 'only screen
and (min-width : 600px)
and (orientation : landscape)',
'large-phone-p' : 'only screen
and (min-width : 480px)
and (orientation : portrait)',
/* tablet lanscape, portrait and both. */
'tablet-lp' : 'only screen
and (min-width : 768px)',
'tablet-l' : 'only screen
and (min-width : 768px)
and (max-width : 1024px)
and (orientation : landscape)',
'tablet-p' : 'only screen
and (min-width : 768px)
and (max-width : 1024px)
and (orientation : portrait)',
/* medium device */
'medium-device' : 'only screen
and (min-width : 992px)',
/* Large Screen*/
'large-screen' : 'only screen and (min-width: 1440px)',
/* iPhone 4 */
'iphone-4' : 'only screen
and (-webkit-min-device-pixel-ratio : 1.5)
and (min-device-pixel-ratio : 1.5)',
'print' : 'print'
);
@function generate-content-media-query($breakpoint) {
@return 'only screen
and (min-width : ' + $breakpoint + ')';
}
@mixin respond-to($media, $breakpoint : '0px') {
$media-query : '';
@if $media == 'content' {
$media-query : generate-content-media-query($breakpoint);
} @else {
$media-query : map-get($media-register, $media);
}
@media #{$media-query} { @content; }
}