virtual-selector
Version:
Virtual selector component for react.js
103 lines (96 loc) • 2.13 kB
text/less
// Default theme.
.selector-container {
color: #444;
margin: 2px;
min-width: 140px;
min-height: 30px;
font-size: 14px;
position: relative;
display: inline-block;
box-sizing: border-box;
vertical-align: top;
background-color: #FFF;
&.selector-opened {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
.selector-selection:after {
border-width: 0 4px 4px 4px;
border-color: transparent transparent @color-default transparent;
}
}
.selector-selection {
overflow: hidden;
padding-right: ;
position: relative;
padding: 4px 30px 0 4px;
border-width: @border-width;
border-color: @color-default;
border-style: solid;
border-radius: @selection-border-radius;
&:after {
content: '';
border-color: @color-default transparent transparent transparent;
border-style: solid;
border-width: 4px 4px 0 4px;
position: absolute;
top: 50%;
right: 10px;
margin-top: -2px;
}
}
.selector-filter {
outline: none;
background-color: transparent;
width: 100%;
height: 30px;
line-height: 30px;
outline: none;
display: block;
padding: 6px 8px;
border-width: 1px;
border-color: @color-default;
border-style: solid;
box-sizing: border-box;
}
.selector-renderer {
clear: both;
display: table-cell;
list-style: none;
padding: 0;
}
.selector-clearer {
cursor: pointer;
position: absolute;
right: 25px;
top: 50%;
height: 24px;
line-height: 24px;
margin-top: -12px;
}
// Clearable.
.selector-clearable {
padding-right: 36px;
}
// Searchable.
.selector-searchable {
width: 100%;
padding: 4px;
display: block;
}
// Placeholder.
.selector-placeholder {
padding-bottom: 4px;
float: left;
height: 24px;
}
}
.loop-status (@i: length(@status)) when (@i > 0) {
@state: e(extract(@status, @i));
@color: ~"@{color-@{state}}";
.selector-container {
&.selector-@{state} {
.selector-variant(@color);
}
}
.loop-status(@i - 1);
} .loop-status;