-
Notifications
You must be signed in to change notification settings - Fork 0
/
_responsive.scss
66 lines (56 loc) · 2.06 KB
/
_responsive.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
/**
* Responsive media query mixins
* =================================
* - These are used so that we can define separate media-query content
* - Arguments can use:
* - a named breakpoint in the $breakpoints map, e.g. mid
* - a pixel value e.g. 500px
* - a unitless value that is eqivalent to a pixel e.g. 500
*/
// $mq-base variable:
//
// This is needed because browsers do not calculate em-based
// media queries correctly. It is set to 16 because we think
// the majority of users will have their browser set to 100%
// zoom level.
//
// See below for an explanation:
// http://www.filamentgroup.com/lab/how-we-learned-to-leave-body-font-size-alone.html
$mq-base: 16;
/**
* Min-width media query:
* - Equivalent to: @media screen and (min-width: 20em) { ... }
* - Usage: @include ko-respond-min(mid) { ... };
*/
@mixin ko-respond-min($width) {
@warn "This mixin will be deprecated soon, please use the include-media plugin for defining your media queries";
$width-em: ko-em(ko-strip-units(ko-bp($width)), $mq-base);
@media screen and (min-width: $width-em) {
@content;
}
}
/**
* Max-width media query:
* - Equivalent to: @media screen and (max-width: 20em) { ... }
* - Usage: @include ko-respond-max(mid) { ... };
*/
@mixin ko-respond-max($width) {
@warn "This mixin will be deprecated soon, please use the include-media plugin for defining your media queries";
$width-em: ko-em(ko-strip-units(ko-bp($width)), $mq-base);
@media screen and (max-width: $width-em) {
@content;
}
}
/**
* Min-max-width media query:
* - Equivalent to: @media screen and (min-width: 10em) and (max-width: 20em) { ... }
* - Usage: @include ko-respond-min-max(narrow, 600) { ... };
*/
@mixin ko-respond-min-max($min-width, $max-width) {
@warn "This mixin will be deprecated soon, please use the include-media plugin for defining your media queries";
$min-width-em: ko-em(ko-strip-units(ko-bp($min-width)), $mq-base);
$max-width-em: ko-em(ko-strip-units(ko-bp($max-width)), $mq-base);
@media screen and (min-width: $min-width-em) and (max-width: $max-width-em) {
@content;
}
}