-
Notifications
You must be signed in to change notification settings - Fork 0
/
fancy-select.scss
208 lines (167 loc) · 4.52 KB
/
fancy-select.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
/**
* Setup
* ----------------------------------------------------------------------------
*/
@mixin vendor($property, $value...){
-webkit-#{$property}:$value;
-moz-#{$property}:$value;
-ms-#{$property}:$value;
-o-#{$property}:$value;
#{$property}:$value;
}
$select-menu-width: 200px;
$border-arrow-color: #dadada;
$active-border-arrow-color: #5897FB;
input:focus,
select:focus,
textarea:focus,
button:focus,
.select-menu {
outline: none;
}
.select-menu:focus {
border: 1px solid $active-border-arrow-color;
}
/**
* Generic extend classes
* ----------------------------------------------------------------------------
*/
%relative {
position: relative;
}
%absolute {
position: absolute;
}
/**
* Base setup
* ----------------------------------------------------------------------------
*/
.select--hidden {
display: none;
}
.select-menu ul {
list-style: none;
margin:0px;
padding:0px;
}
.select-menu li {
margin: 0;
}
/**
* Visible input
* ----------------------------------------------------------------------------
*/
.select-menu {
background: #fff;
border-radius: 4px;
border: 1px solid $border-arrow-color;
@extend %relative;
width: $select-menu-width;
}
.select-menu--active {
border: 1px solid $active-border-arrow-color;
}
.select-menu__current {
color: #666;
cursor: pointer;
display: block;
font-size: 16px;
overflow: hidden;
padding: 6px 15px 5px;
text-overflow: ellipsis;
white-space: nowrap;
}
.arrow-fade {
background: -moz-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 50%); /* FF3.6+ */
background: -ms-linear-gradient(left, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 50%); /* IE10+ */
background: -o-linear-gradient(left, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 50%); /* Opera 11.10+ */
background: -webkit-gradient(linear, left top, right top, color-stop(0%,rgba(255,255,255,0)), color-stop(50%,rgba(255,255,255,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(left, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 50%); /* Chrome10+,Safari5.1+ */
background: linear-gradient(to right, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 50%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#ffffff',GradientType=1 ); /* IE6-9 */
bottom: 1px;
@extend %absolute;
right: 0;
top: 1px;
width: 50px;
}
.arrow-fade:before {
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-top: 5px solid $border-arrow-color;
content: " ";
height: 0;
@extend %absolute;
right: 10px;
top: 45%;
width: 0;
.select-menu--active & {
border-bottom: 5px solid $active-border-arrow-color;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-top: none;
}
}
/**
* Dropdown wrapper
* ----------------------------------------------------------------------------
*/
.select-menu__wrapper {
background: white;
border-radius: 4px;
border: 1px solid $border-arrow-color;
display: none;
left: -1px;
margin-top: 4px;
overflow: hidden;
padding: 0;
@extend %absolute;
top: 100%;
width: 100%;
z-index: 10;
}
.select-menu--active .select-menu__wrapper {
display: table!important;
}
/**
* Dropdown
* ----------------------------------------------------------------------------
*/
.select-menu__list {
display: table-cell;
font-size: 15px;
line-height: 1.6;
list-style: none;
min-width: 170px;
padding-bottom: 15px;
padding-left: 16px;
padding-top: 15px;
width: auto;
+ .select-menu__list {
border-left: 1px solid $border-arrow-color;
}
&:first-child {
padding-right: 10px;
}
a {
color: #676767;
cursor: pointer;
display: block;
white-space: nowrap;
&:hover {
color: #000;
}
}
.select__item--selected {
color: red;
}
}
.select-menu__title {
font-size: 16px;
margin: 0;
text-transform: uppercase;
font-weight: bold;
+ ul {
margin-top: 5px;
}
}