forked from sass-mq/sass-mq
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path_after-import.scss
165 lines (151 loc) · 4.66 KB
/
_after-import.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
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
// Styles for responsive and static output, wrapped in a mixin for reuse.
@mixin styles {
// Up to mobile
@include mq($until: mobile) {
content: "to-mobile";
}
// From mobile and up
@include mq($from: mobile) {
content: "from-mobile";
}
// From mobile to tablet (exclusive)
@include mq($from: mobile, $until: tablet) {
content: "from-mobile-to-tablet";
}
// From unitless value
@include mq(640) {
content: "from-640";
}
// Up to tablet
@include mq($until: tablet) {
content: "to-tablet";
}
// Combine upper limit and custom directive
@include mq($until: tablet, $and: '(orientation: landscape)') {
content: "to-tablet-and-orientation-landscape";
}
// From tablet and up
@include mq($from: tablet) {
content: "from-tablet";
}
// From tablet to desktop (exclusive)
@include mq($from: tablet, $until: desktop) {
content: "from-tablet-to-desktop";
}
// Combine unitless boundaries and custom directive
@include mq(768, 1023, $and: '(orientation: portrait)') {
content: "from-768-to-1023-and-orientation-portrait";
}
// From desktop and up
@include mq($from: desktop) {
content: "from-desktop";
}
// From em value
@include mq($until: 70em) {
content: "to-70em";
}
// To pixel value
@include mq($until: 1100px) {
content: "to-1100px";
}
// From desktop to widescreen (exclusive)
@include mq($from: desktop, $until: widescreen) {
content: "from-desktop-to-widescreen";
}
// From widescreen and up
@include mq($from: widescreen) {
content: "from-widescreen";
}
// From widescreen to tvscreen (exclusive)
@include mq($from: widescreen, $until: tvscreen) {
content: "from-widescreen-to-tvscreen";
}
// From tvscreen and up
@include mq($from: tvscreen) {
content: "from-tvscreen";
}
// Custom @media query
@include mq($and: '(-webkit-min-device-pixel-ratio: 1.3), (min-resolution: 124.8dpi), (min-resolution: 1.3dppx)') {
content: "hidpi-screen";
}
// Empty @media query
@include mq() {
content: "empty-media-query";
}
@include mq-add-breakpoint(cinema, 4096px);
@include mq(cinema) {
content: "from-cinema";
}
/* Added a custom breakpoint: #{inspect($mq-breakpoints)} */
@include mq-add-breakpoint(tiny, 16px);
/* Added a tiny breakpoint: #{inspect($mq-breakpoints)} */
@include mq-add-breakpoint(tiny2, 16px);
@include mq(tiny2) {
content: "from-tiny2";
}
/* Added a tiny2 breakpoint at a previously added size: #{inspect($mq-breakpoints)} */
@include mq-add-breakpoint(tablet2, 640px);
@include mq(tablet2) {
content: "from-tablet2";
}
/* Added a tablet2 breakpoint at an existing initial size (already in $mq-breakpoints):
#{inspect($mq-breakpoints)} */
@include mq-add-breakpoint(middle, 550px);
/* Added a breakpoint in the middle #{inspect($mq-breakpoints)} */
@include mq($until: cinema) {
content: "to-cinema";
}
$my-breakpoints: (
L: 900px,
XL: 1200px
);
$my-static-breakpoint: L;
@include mq($from: L, $breakpoints: $my-breakpoints, $static-breakpoint: $my-static-breakpoint) {
content: "custom-breakpoint-list";
}
}
/* Responsive styles for devices that understand media queries */
.responsive:after {
@include styles;
}
/* Rasterized styles that span or start at the "desktop" breakpoint */
// (e.g. to serve to IE8 via conditional comments in a separate stylesheet)
$mq-responsive: false;
$mq-static-breakpoint: desktop;
.static:after {
@include styles;
}
.static-forced:after {
@include mq(mobile, desktop, $static-breakpoint: tablet, $responsive: false) {
content: "Static, forced to tablet";
}
@include mq(desktop, $static-breakpoint: tablet, $responsive: false) {
content: "Should not appear, because out of the bounds of $static-breakpoint";
}
}
/* Do not rasterize print media queries into when $mq-responsive is false */
$mq-responsive: false;
$mq-media-type: all;
@include mq($media-type: 'print') {
.print:after {
content: "Should not appear, because print style only";
}
}
/* Only style screen media type */
$mq-responsive: true;
$mq-media-type: screen;
body {
@include mq($until: mobile) {
font-size: 1rem;
}
@include mq($until: mobile, $media-type: 'screen, print') {
content: "screen-and-print";
}
}
/* Only style print media type */
$mq-media-type: print;
body {
@include mq($until: mobile) {
font-size: 2rem;
}
}