selectric
Version:
Fast, simple and light jQuery plugin to customize HTML selects
250 lines (219 loc) • 4.76 kB
CSS
/*======================================
Selectric
======================================*/
.selectric-wrapper {
position: relative;
cursor: pointer;
}
.selectric-disabled {
filter: alpha(opacity=50);
opacity: 0.5;
cursor: default;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.selectric-open {
z-index: 9999;
}
.selectric-open .selectric-items {
display: block;
}
.selectric-hide-select {
position: relative;
overflow: hidden;
width: 0;
height: 0;
}
.selectric-hide-select select {
position: absolute;
left: -100%;
}
.selectric-hide-select.selectric-is-native {
position: absolute;
width: 100%;
height: 100%;
z-index: 10;
}
.selectric-hide-select.selectric-is-native select {
position: absolute;
top: 0;
left: 0;
right: 0;
height: 100%;
width: 100%;
border: none;
z-index: 1;
box-sizing: border-box;
opacity: 0;
}
.selectric-input {
position: absolute ;
top: 0 ;
left: 0 ;
overflow: hidden ;
clip: rect(0, 0, 0, 0) ;
margin: 0 ;
padding: 0 ;
width: 1px ;
height: 1px ;
outline: none ;
border: none ;
_font: 0/0 a;
background: none ;
}
.selectric-temp-show {
position: absolute ;
visibility: hidden ;
display: block ;
}
.selectric-open .selectric {
border-color: #CCC;
background: #F0F0F0;
z-index: 9999;
}
.selectric {
background-color: #f5f5f5;
background-image: -webkit-linear-gradient(#fff, #e6e6e6);
background-image: -o-linear-gradient(#fff, #e6e6e6);
background-image: linear-gradient(#fff, #e6e6e6);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);
border-color: #e6e6e6 #e6e6e6 #bfbfbf;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
*background-color: #e6e6e6;
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
border: 1px solid #cccccc;
*border: 0;
border-bottom-color: #b3b3b3;
border-radius: 3px;
position: relative;
}
.selectric .label {
display: block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin: 0 30px 0 0;
padding: 6px;
font-size: 12px;
line-height: 18px;
color: #444;
min-height: 18px;
}
.selectric .button {
display: block;
position: absolute;
right: 0;
top: 0;
width: 30px;
height: 30px;
color: #BBB;
text-align: center;
font: 0/0 a;
/* IE Fix */
*font: 20px/30px Lucida Sans Unicode, Arial Unicode MS, Arial;
}
.selectric .button:after {
content: " ";
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
margin: auto;
width: 0;
height: 0;
border: 4px solid transparent;
border-top-color: #BBB;
border-bottom: none;
}
.selectric-focus .selectric {
border-color: #AAA;
}
.selectric-hover .selectric {
border-color: #CCC;
}
.selectric-hover .selectric .button {
color: #888;
}
.selectric-hover .selectric .button:after {
border-top-color: #888;
}
/* Items box */
.selectric-items {
display: none;
position: absolute;
top: 100%;
left: 0;
background: #F8F8F8;
border: 1px solid #C4C4C4;
z-index: -1;
box-shadow: 0 0 10px -6px;
}
.selectric-items .selectric-scroll {
height: 100%;
overflow: auto;
}
.selectric-above .selectric-items {
top: auto;
bottom: 100%;
}
.selectric-items ul, .selectric-items li {
list-style: none;
padding: 0;
margin: 0;
font-size: 12px;
line-height: 20px;
min-height: 20px;
}
.selectric-items li {
display: block;
padding: 8px;
border-top: 1px solid #FFF;
border-bottom: 1px solid #EEE;
color: #666;
cursor: pointer;
}
.selectric-items li.selected {
background: #EFEFEF;
color: #444;
}
.selectric-items li.highlighted {
background: #D0D0D0;
color: #444;
}
.selectric-items li:hover {
background: #F0F0F0;
color: #444;
}
.selectric-items .disabled {
filter: alpha(opacity=50);
opacity: 0.5;
cursor: default ;
background: none ;
color: #666 ;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.selectric-items .selectric-group .selectric-group-label {
font-weight: bold;
padding-left: 10px;
cursor: default;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
background: none;
color: #444;
}
.selectric-items .selectric-group.disabled li {
filter: alpha(opacity=100);
opacity: 1;
}
.selectric-items .selectric-group li {
padding-left: 25px;
}