-
Notifications
You must be signed in to change notification settings - Fork 22
/
material-shadows.scss
108 lines (91 loc) · 2.52 KB
/
material-shadows.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
//
// Name: Material Shadows
// Description: Mixins for Material Design Shadows.
// Version: 3.0.1
//
// Author: Denis Malinochkin
// Git: https://github.com/mrmlnc/material-shadows
//
// twitter: @mrmlnc
//
// ------------------------------------
// Mixins
// ------------------------------------
@mixin z-depth-transition() {
transition: box-shadow .28s cubic-bezier(.4, 0, .2, 1);
}
@mixin z-depth-focus() {
box-shadow: 0 0 8px rgba(0, 0, 0, .18), 0 8px 16px rgba(0, 0, 0, .36);
}
@mixin z-depth-2dp() {
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14),
0 1px 5px 0 rgba(0, 0, 0, .12),
0 3px 1px -2px rgba(0, 0, 0, .2);
}
@mixin z-depth-3dp() {
box-shadow: 0 3px 4px 0 rgba(0, 0, 0, .14),
0 1px 8px 0 rgba(0, 0, 0, .12),
0 3px 3px -2px rgba(0, 0, 0, .4);
}
@mixin z-depth-4dp() {
box-shadow: 0 4px 5px 0 rgba(0, 0, 0, .14),
0 1px 10px 0 rgba(0, 0, 0, .12),
0 2px 4px -1px rgba(0, 0, 0, .4);
}
@mixin z-depth-6dp() {
box-shadow: 0 6px 10px 0 rgba(0, 0, 0, .14),
0 1px 18px 0 rgba(0, 0, 0, .12),
0 3px 5px -1px rgba(0, 0, 0, .4);
}
@mixin z-depth-8dp() {
box-shadow: 0 8px 10px 1px rgba(0, 0, 0, .14),
0 3px 14px 2px rgba(0, 0, 0, .12),
0 5px 5px -3px rgba(0, 0, 0, .4);
}
@mixin z-depth-16dp() {
box-shadow: 0 16px 24px 2px rgba(0, 0, 0, .14),
0 6px 30px 5px rgba(0, 0, 0, .12),
0 8px 10px -5px rgba(0, 0, 0, .4);
}
@mixin z-depth-24dp() {
box-shadow: 0 9px 46px 8px rgba(0, 0, 0, .14),
0 24px 38px 3px rgba(0, 0, 0, .12),
0 11px 15px -7px rgba(0, 0, 0, .4);
}
@mixin z-depth($dp: 2) {
@if $dp == 2 {
@include z-depth-2dp();
} @else if $dp == 3 {
@include z-depth-3dp();
} @else if $dp == 4 {
@include z-depth-4dp();
} @else if $dp == 6 {
@include z-depth-6dp();
} @else if $dp == 8 {
@include z-depth-8dp();
} @else if $dp == 16 {
@include z-depth-16dp();
} @else if $dp == 24 {
@include z-depth-24dp();
}
}
// Class generator
// ------------------------------------
@mixin z-depth-classes($transition: false, $focus: false) {
@if $transition == true {
&-transition {
@include z-depth-transition();
}
}
@if $focus == true {
&-focus {
@include z-depth-focus();
}
}
// The available values for the shadow depth
@each $depth in 2, 3, 4, 6, 8, 16, 24 {
&-#{$depth}dp {
@include z-depth($depth);
}
}
}