-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgray.css
54 lines (45 loc) · 1.21 KB
/
gray.css
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
/*! Gray v1.5.0 (https://github.com/karlhorky/gray) | MIT */
.grayscale {
/* Firefox 10-34 */
filter: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><filter id='grayscale'><feColorMatrix type='saturate' values='0'/></filter></svg>#grayscale");
/*
Chrome 19+,
Safari 6+,
Safari 6+ iOS,
Opera 15+
*/
-webkit-filter: grayscale(1);
/* Firefox 35+ */
filter: grayscale(1);
/* IE 6-9 */
filter: gray;
}
.grayscale.grayscale-fade {
transition: filter .5s;
}
/* Webkit hack until filter is unprefixed */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
.grayscale.grayscale-fade {
-webkit-transition: -webkit-filter .5s;
transition: -webkit-filter .5s;
}
}
.grayscale.grayscale-off,
.grayscale.grayscale-fade:hover {
-webkit-filter: grayscale(0);
filter: grayscale(0);
}
/* Background element */
.grayscale.grayscale-replaced {
-webkit-filter: none;
filter: none;
}
.grayscale.grayscale-replaced > svg {
-webkit-transition: opacity .5s ease;
transition: opacity .5s ease;
opacity: 1;
}
.grayscale.grayscale-replaced.grayscale-off > svg,
.grayscale.grayscale-replaced.grayscale-fade:hover > svg {
opacity: 0;
}