-
Notifications
You must be signed in to change notification settings - Fork 4
/
responsive.styl
68 lines (51 loc) · 1.82 KB
/
responsive.styl
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
same = false
-image(name)
background-image url("/images/" + name + ".png")
-image-2x(name)
size = image-size("../images/" + name + ".png")
.backgroundsize &
background-image url("/images/" + name + "@2x.png")
background-size size[0] size[1]
-image-browser(name)
-image name
@media all and (-webkit-min-device-pixel-ratio: 1.5)
-image-2x name
-image-tablet(name)
@media all and (max-width: 979px)
-image name
@media all and (-webkit-min-device-pixel-ratio: 1.5) and (max-width: 979px)
-image-2x name
-image-phone(name)
@media all and (max-width: 767px)
-image name
@media all and (-webkit-min-device-pixel-ratio: 1.5) and (max-width: 767px)
-image-2x name
image(name)
-image-browser name
-image-responsive(browser-value, tablet-value, phone-value = same)
-image-browser browser-value
if tablet-value is not same and tablet-value != browser-value
-image-tablet tablet-value
if phone-value is not same and phone-value != tablet-value
-image-phone phone-value
browser(name, value)
add-property name, value
tablet(name, value)
@media (max-width: 979px)
add-property name, value
phone(name, value)
@media (max-width: 767px)
add-property name, value
responsive(name, browser-value, tablet-value, phone-value = same)
if s("%s", name) == "image"
-image-responsive browser-value tablet-value phone-value
else
browser name browser-value
if tablet-value is not same and tablet-value != browser-value
tablet name tablet-value
if phone-value is not same and phone-value != tablet-value
phone name phone-value
svg(name)
.svg &
background-image url("/images/" + name + ".svg") !important
background-size 100%