amis2/scss/components/form/_picker.scss

103 lines
2.1 KiB
SCSS
Raw Normal View History

2019-04-30 11:11:25 +08:00
.#{$ns}Picker {
2019-12-06 09:58:08 +08:00
@include input-text();
outline: none;
2019-07-25 11:24:36 +08:00
2019-12-06 09:58:08 +08:00
&.is-focus > &-input {
border-color: var(--Form-input-onFocused-borderColor);
box-shadow: var(--Form-input-boxShadow);
background: var(--Form-input-onFocused-bg);
2019-12-06 09:58:08 +08:00
}
2020-12-25 16:43:21 +08:00
&.is-disabled {
pointer-events: none;
opacity: var(--Button-onDisabled-opacity);
}
2019-12-06 09:58:08 +08:00
&-placeholder {
color: var(--Form-input-placeholderColor);
2019-12-06 09:58:08 +08:00
user-select: none;
position: absolute;
// margin-top: 2 * var(--Form-input-borderWidth);
line-height: var(--Form-input-lineHeight);
2019-12-06 09:58:08 +08:00
}
&-input {
min-height: var(--Form-input-height);
2019-12-06 09:58:08 +08:00
height: auto;
}
.#{$ns}Picker-values {
display: inline;
}
&-valueWrap {
flex-grow: 1;
position: relative;
> input {
width: 1rem;
display: inline-block;
2019-07-25 11:24:36 +08:00
}
2019-12-06 09:58:08 +08:00
}
.#{$ns}Picker-valueWrap {
margin-bottom: calc(var(--gap-xs) * -1);
2019-12-06 09:58:08 +08:00
line-height: 1;
}
.#{$ns}Picker-value {
cursor: pointer;
user-select: none;
white-space: nowrap;
vertical-align: middle;
line-height: calc(
var(--Form-input-lineHeight) * var(--Form-input-fontSize) - #{px2rem(2px)}
);
2019-12-06 09:58:08 +08:00
display: inline-block;
font-size: var(--Form-selectValue-fontSize);
color: var(--Form-selectValue-color);
background: var(--Form-selectValue-bg);
border: px2rem(1px) solid var(--Form-selectValue-borderColor);
2019-12-06 09:58:08 +08:00
border-radius: 2px;
margin-right: var(--gap-xs);
margin-bottom: var(--gap-xs);
2019-12-06 09:58:08 +08:00
}
2019-07-25 11:24:36 +08:00
2019-12-06 09:58:08 +08:00
.#{$ns}Picker-valueIcon {
cursor: pointer;
border-right: px2rem(1px) solid var(--Form-selectValue-borderColor);
2019-12-06 09:58:08 +08:00
padding: 1px 5px;
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&:hover {
background: var(--Form-selectValue-onHover-bg);
2019-04-30 11:11:25 +08:00
}
2019-12-06 09:58:08 +08:00
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
.#{$ns}Picker-valueLabel {
padding: 0 var(--gap-xs);
2019-12-06 09:58:08 +08:00
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&-btn {
cursor: pointer;
color: var(--Picker-iconColor);
2019-07-25 11:24:36 +08:00
2019-12-06 09:58:08 +08:00
&:hover {
color: var(--Picker-onHover-iconColor);
2019-07-25 11:24:36 +08:00
}
2019-12-06 09:58:08 +08:00
}
&-clear {
display: inline-block;
@include input-clear();
line-height: 1;
margin-right: var(--gap-xs);
2019-12-06 09:58:08 +08:00
}
2019-04-30 11:11:25 +08:00
}
2019-07-25 11:59:01 +08:00
.#{$ns}PickerControl.is-inline {
2019-12-06 09:58:08 +08:00
.#{$ns}Picker {
display: inline-block;
min-width: px2rem(150px);
}
}