iview/src/styles/components/select.less

296 lines
6.9 KiB
Text
Raw Normal View History

@select-prefix-cls: ~"@{css-prefix}select";
@select-item-prefix-cls: ~"@{css-prefix}select-item";
@select-group-prefix-cls: ~"@{css-prefix}select-group";
.@{select-prefix-cls} {
display: inline-block;
width: 100%;
box-sizing: border-box;
vertical-align: middle;
color: @text-color;
font-size: @font-size-base;
2017-01-12 18:04:55 +08:00
//position: relative;
2017-01-04 14:55:16 +08:00
line-height: normal;
&-selection {
display: block;
box-sizing: border-box;
outline: none;
user-select: none;
cursor: pointer;
2017-01-12 18:04:55 +08:00
position: relative;
background-color: #fff;
border-radius: @btn-border-radius;
border: 1px solid @border-color-base;
transition: all @transition-time @ease-in-out;
2018-03-27 09:58:27 +02:00
&:hover, &-focused {
.hover();
2018-03-27 09:58:27 +02:00
.@{select-prefix-cls}-arrow {
display: inline-block;
}
}
}
&-arrow {
2016-11-16 10:07:03 +08:00
.inner-arrow();
}
&-visible{
.@{select-prefix-cls}-selection{
.active();
}
2018-03-27 09:58:27 +02:00
.@{select-prefix-cls}-arrow {
transform: rotate(180deg);
2018-03-27 09:58:27 +02:00
display: inline-block;
}
}
&-disabled {
.@{select-prefix-cls}-selection {
.disabled();
2018-03-27 09:58:27 +02:00
.@{select-prefix-cls}-arrow {
display: none;
}
&:hover {
border-color: @border-color-base;
box-shadow: none;
2018-03-27 09:58:27 +02:00
.@{select-prefix-cls}-arrow {
display: inline-block;
}
}
}
}
&-single &-selection{
height: @input-height-base;
position: relative;
.@{select-prefix-cls}-placeholder{
color: @input-placeholder-color;
}
.@{select-prefix-cls}-placeholder, .@{select-prefix-cls}-selected-value{
display: block;
height: @input-height-base - 2px;
line-height: @input-height-base - 2px;
font-size: @font-size-small;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
padding-left: 8px;
padding-right: 24px;
}
}
2018-03-13 16:23:51 +08:00
&-multiple &-selection{
padding: 0 24px 0 4px;
//min-height: @input-height-base;
.@{select-prefix-cls}-placeholder{
display: block;
height: @input-height-base - 2px;
line-height: @input-height-base - 2px;
color: @input-placeholder-color;
font-size: @font-size-small;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
padding-left: 4px;
padding-right: 22px;
}
}
&-large&-single &-selection{
height: @input-height-large;
.@{select-prefix-cls}-placeholder, .@{select-prefix-cls}-selected-value{
height: @input-height-large - 2px;
line-height: @input-height-large - 2px;
font-size: @font-size-base;
}
}
2018-03-13 16:23:51 +08:00
&-large&-multiple &-selection{
min-height: @input-height-large;
.@{select-prefix-cls}-placeholder, .@{select-prefix-cls}-selected-value{
min-height: @input-height-large - 2px;
line-height: @input-height-large - 2px;
font-size: @font-size-base;
}
}
&-small&-single &-selection{
height: @input-height-small;
border-radius: @btn-border-radius-small;
.@{select-prefix-cls}-placeholder, .@{select-prefix-cls}-selected-value{
height: @input-height-small - 2px;
line-height: @input-height-small - 2px;
}
}
2018-03-13 16:23:51 +08:00
&-small&-multiple &-selection{
min-height: @input-height-small;
border-radius: @btn-border-radius-small;
2018-03-13 16:23:51 +08:00
.@{select-prefix-cls}-placeholder, .@{select-prefix-cls}-selected-value{
height: auto;
min-height: @input-height-small - 2px;
line-height: @input-height-small - 2px;
}
}
// input
&-input{
display: inline-block;
height: @input-height-base;
line-height: @input-height-base;
padding: 0 24px 0 8px;
font-size: @font-size-small;
outline: none;
border: none;
box-sizing: border-box;
color: @input-color;
background-color: transparent;
position: relative;
cursor: pointer;
.placeholder();
2018-01-23 16:30:34 +08:00
&[disabled]{
cursor: @cursor-disabled;
color: #ccc;
}
}
&-single &-input{
width: 100%;
}
&-large &-input{
font-size: @font-size-base;
height: @input-height-large;
}
&-small &-input{
2017-09-15 14:48:39 +08:00
height: @input-height-small - 2px;
line-height: @input-height-small - 2px;
}
&-multiple &-input{
height: @input-height-base - 3px;
line-height: @input-height-base;
2017-01-04 14:55:16 +08:00
padding: 0 0 0 4px;
}
&-not-found{
text-align: center;
color: @btn-disable-color;
2017-05-18 16:34:09 +08:00
li:not([class^=ivu-]){
margin-bottom: 0;
}
}
2017-05-05 14:20:46 +08:00
&-loading{
text-align: center;
color: @btn-disable-color;
}
&-multiple .@{css-prefix}tag{
2018-03-13 16:23:51 +08:00
height: 24px;
line-height: 22px;
margin: 3px 4px 3px 0;
2018-07-01 16:59:27 +08:00
//i{
// top: 2px;
//}
2018-03-13 16:23:51 +08:00
}
&-large&-multiple .@{css-prefix}tag{
height: 28px;
line-height: 26px;
font-size: @font-size-base;
2018-06-25 21:39:38 +08:00
i{
top: 1px;
}
2018-03-13 16:23:51 +08:00
}
&-small&-multiple .@{css-prefix}tag{
height: 17px;
line-height: 15px;
font-size: @font-size-small;
padding: 0 6px;
margin: 3px 4px 2px 0;
2018-06-25 21:39:38 +08:00
i{
top: 1px;
}
}
2018-03-08 21:21:12 +01:00
&-dropdown-list {
2018-05-04 11:00:15 +08:00
//display: inline-block;
2018-03-28 16:00:52 +08:00
min-width: 100%;
2018-03-08 21:21:12 +01:00
list-style: none;
}
}
2016-11-15 19:17:54 +08:00
.select-item(@select-prefix-cls, @select-item-prefix-cls);
.@{select-prefix-cls}-multiple .@{select-item-prefix-cls} {
position: relative;
&-selected{
color: @selected-color;
background: #fff;
}
&-focus,&-selected:hover{
background: @background-color-select-hover;
}
&-selected&-focus {
color: shade(@selected-color, 10%);
background: #fff;
}
&-selected:after{
.ivu-icon();
//float: right;
font-size: 24px;
2018-06-25 20:03:59 +08:00
content: '\F171';
color: @selected-color;
position: absolute;
top: 2px;
2018-06-25 20:27:03 +08:00
right: 8px;
}
}
.@{select-group-prefix-cls} {
list-style: none;
margin: 0;
padding: 0;
&-title {
padding-left: 8px;
font-size: 12px;
color: @legend-color;
height: 30px;
line-height: 30px;
}
}
2017-01-04 17:37:16 +08:00
.@{form-item-prefix-cls}-error{
.@{select-prefix-cls}{
&-selection{
border: 1px solid @error-color;
}
&-arrow{
color: @error-color;
}
&-visible .@{select-prefix-cls}-selection{
.active-error;
}
}
2018-03-08 21:21:12 +01:00
}