-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
filters.scss
113 lines (101 loc) · 2.12 KB
/
filters.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
/*!
* filters.css
* Source: https://github.com/bansal/filters.css
*/
// Config
// ==================================================
$filters-prefix : '' !default;
$hover-prefix: 'hover-' !default;
$transition-duration: ('slow': 500ms, 'medium': 300ms,
'fast': 100ms) !default;
// Filters
// ==================================================
/*
Blur 0px to 10px
*/
@for $i from 0 through 10 {
.#{$filters-prefix}blur-#{$i},
.#{$filters-prefix}#{$hover-prefix}blur-#{$i}:hover {
filter: blur(#{$i}px);
}
}
/*
Grayscale 0 to 1
*/
@for $i from 0 through 10 {
.#{$filters-prefix}grayscale-#{$i},
.#{$filters-prefix}#{$hover-prefix}grayscale-#{$i}:hover {
filter: grayscale($i*0.1);
}
}
/*
Brightness 0% to 200%
*/
@for $i from 0 through 10 {
.#{$filters-prefix}brightness-#{$i},
.#{$filters-prefix}#{$hover-prefix}brightness-#{$i}:hover {
filter: brightness($i*20%);
}
}
/*
Contrast 100% to 200%
*/
@for $i from 0 through 10 {
.#{$filters-prefix}contrast-#{$i},
.#{$filters-prefix}#{$hover-prefix}contrast-#{$i}:hover {
filter: contrast($i*10% + 100%);
}
}
/*
Invert 0% to 100%
*/
@for $i from 0 through 10 {
.#{$filters-prefix}invert-#{$i},
.#{$filters-prefix}#{$hover-prefix}invert-#{$i}:hover {
filter: invert($i*10%);
}
}
/*
Saturate 0% to 100%
*/
@for $i from 0 through 10 {
.#{$filters-prefix}saturate-#{$i},
.#{$filters-prefix}#{$hover-prefix}saturate-#{$i}:hover {
filter: saturate($i*10%);
}
}
/*
Sepia 0% to 100%
*/
@for $i from 0 through 10 {
.#{$filters-prefix}sepia-#{$i},
.#{$filters-prefix}#{$hover-prefix}sepia-#{$i}:hover {
filter: sepia($i*10%);
}
}
/*
Backdrop Blur 0px to 10px
*/
@for $i from 0 through 10 {
.#{$filters-prefix}backdrop-blur-#{$i},
.#{$filters-prefix}#{$hover-prefix}backdrop-blur-#{$i}:hover {
backdrop-filter: blur(#{$i}px);
}
}
/*
Opacity 0% to 100%
*/
@for $i from 0 through 10 {
.#{$filters-prefix}opacity-#{$i},
.#{$filters-prefix}#{$hover-prefix}opacity-#{$i}:hover {
opacity: $i*0.1;
}
}
/*
Hover transition
*/
@each $name,$value in $transition-duration {
.transition-#{$name} {
transition: all $value ease;
}
}