-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathdropdown.scss
118 lines (112 loc) · 3.07 KB
/
dropdown.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
// * * * Variables * * *
$default-text-hover-color: black;
$default-hover-color: #cde4f5;
$default-text-color: #fff;
$option-padding: 4px 10px;
.dropdown {
display: flex;
align-items: center;
justify-content: space-between;
flex-direction: column;
width: var(--dropdown-width);
position: relative;
border: 1px solid transparent;
border-radius: var(--main-el-border-radius);
cursor: pointer;
color: var(--dropdown-default-text-color);
background: var(--dropdown-background-color);
user-select: none;
transition: all 0.7s linear;
.dropdown-label-container {
display: flex;
width: 100%;
.dropdown-label {
display: flex;
justify-content: space-between;
flex: 1 1 auto;
align-items: center;
height: var(--option-height);
padding: $option-padding;
.text {
font-family: "Source Sans Pro", sans-serif;
font-size: 24px;
}
.angle-down {
display: flex;
justify-content: center;
align-items: center;
border: solid $default-text-color;
background: transparent;
border-width: 0 2px 2px 0;
padding: 4px;
width: 1px;
height: 1px;
margin: -3px 5px 0 0;
border-color: var(--dropdown-default-text-color);
transform: rotate(45deg);
transition: all 0.7s;
}
.toggled {
margin-bottom: -12px;
transform: rotate(-135deg);
transition: all 0.7s;
}
}
}
.options {
width: 100%;
.option {
display: flex;
align-items: center;
padding: $option-padding;
height: 35px;
font-family: "Source Sans Pro", sans-serif;
font-size: 18px;
}
.option:hover {
color: $default-text-hover-color;
background: $default-hover-color;
transition: all 0.7s;
}
.option:last-child {
border-radius: 0 0 var(--main-el-border-radius)
var(--main-el-border-radius);
}
.option:last-child:hover {
border-radius: 0 0 var(--main-el-border-radius)
var(--main-el-border-radius);
}
}
&.disabled {
cursor: not-allowed;
}
}
.dropdown.expanded {
background: var(--dropdown-expanded-color);
border: var(--dropdown-border);
transition: all 0.7s linear;
}
// Expand Class - Most important part
.expand {
overflow: hidden;
transition-property: height;
transition-duration: 0.4s; // Durations can be changed without touching JS
transition-timing-function: cubic-bezier(
0.175,
0.885,
0.32,
1.275
); // Timing functions also!
&[aria-expanded="false"] {
height: 0 !important;
transition-timing-function: cubic-bezier(
0.6,
-0.28,
0.735,
0.045
); // Timing function can be different for each direction
}
}
// Smartphones - Landscape + Portrait
@media only screen and (min-device-width: 320px) and (max-device-width: 480px) {
}