amis2/scss/components/form/_input-group.scss

151 lines
3.6 KiB
SCSS
Raw Normal View History

2019-04-30 11:11:25 +08:00
.#{$ns}InputGroup {
2019-12-06 09:58:08 +08:00
display: inline-flex;
flex-wrap: nowrap;
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&.#{$ns}Form-control--sizeXs,
&.#{$ns}Form-control--sizeSm,
&.#{$ns}Form-control--sizeMd,
&.#{$ns}Form-control--sizeLg {
display: inline-flex;
}
&-addOn,
& .#{$ns}Form-control {
display: inline-block;
white-space: nowrap;
}
&-addOn {
background: var(--InputGroup-addOn-bg);
border: var(--InputGroup-addOn-borderWidth) solid
var(--InputGroup-addOn-borderColor);
line-height: calc(
var(--InputGroup-height) - var(--InputGroup-paddingY) * 2 -
var(--InputGroup-addOn-borderWidth) * 2
);
height: var(--InputGroup-height);
2019-12-06 09:58:08 +08:00
box-sizing: border-box;
padding: var(--InputGroup-paddingY) var(--InputGroup-paddingX);
2019-12-06 09:58:08 +08:00
&:not(:last-child) {
border-right: 0;
2019-04-30 11:11:25 +08:00
}
2019-12-06 09:58:08 +08:00
&:first-child {
border-top-left-radius: var(--InputGroup-addOn-borderRadius);
border-bottom-left-radius: var(--InputGroup-addOn-borderRadius);
2019-04-30 11:11:25 +08:00
}
2019-12-06 09:58:08 +08:00
&:last-child {
border-top-right-radius: var(--InputGroup-addOn-borderRadius);
border-bottom-right-radius: var(--InputGroup-addOn-borderRadius);
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 {
.#{$ns}Button {
border-radius: 0;
border: var(--InputGroup-button-borderWidth) solid
var(--InputGroup-button-borderColor);
2019-12-06 09:58:08 +08:00
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&:not(:last-child) .#{$ns}Button {
border-right: 0;
2019-04-30 11:11:25 +08:00
}
2019-12-06 09:58:08 +08:00
&:first-child .#{$ns}Button {
border-top-left-radius: var(--InputGroup-button-borderRadius);
border-bottom-left-radius: var(--InputGroup-button-borderRadius);
2019-12-06 09:58:08 +08:00
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&:last-child .#{$ns}Button {
border-top-right-radius: var(--InputGroup-button-borderRadius);
border-bottom-right-radius: var(--InputGroup-button-borderRadius);
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}TextControl-input {
flex-basis: 0;
flex-grow: 1;
display: inline-flex;
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&:not(:first-child) {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
2019-04-30 11:11:25 +08:00
}
2019-12-06 09:58:08 +08:00
&:not(:last-child) {
border-right-width: 0;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
.#{$ns}SelectControl {
.#{$ns}Select {
background: var(--InputGroup-select-bg);
border: var(--InputGroup-select-borderWidth) solid
var(--InputGroup-select-borderColor);
color: var(--InputGroup-select-color);
}
&:not(:last-child) .#{$ns}Select {
border-right: 0;
}
&:first-child .#{$ns}Select {
border-top-left-radius: var(--InputGroup-select-borderRadius);
border-bottom-left-radius: var(--InputGroup-select-borderRadius);
}
&:last-child .#{$ns}Select {
border-top-right-radius: var(--InputGroup-select-borderRadius);
border-bottom-right-radius: var(--InputGroup-select-borderRadius);
2019-04-30 11:11:25 +08:00
}
2019-12-06 09:58:08 +08:00
&:not(:first-child) .#{$ns}Select {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
2019-04-30 11:11:25 +08:00
}
2019-12-06 09:58:08 +08:00
&:not(:last-child) .#{$ns}Select {
border-right-width: 0;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
}
.#{$ns}Select-arrow {
color: var(--InputGroup-select-arrowColor);
2019-12-06 09:58:08 +08:00
}
&.is-focused {
.#{$ns}InputGroup-addOn,
.#{$ns}TextControl-input,
.#{$ns}Select,
.#{$ns}InputGroup-btn .#{$ns}Button {
border-color: var(--InputGroup-addOn-onFocused-borderColor);
2019-12-06 09:58:08 +08:00
}
2019-04-30 11:11:25 +08:00
.#{$ns}Select {
background: var(--InputGroup-select-onFocused-bg);
2019-12-06 09:58:08 +08:00
}
2019-04-30 11:11:25 +08:00
.#{$ns}Select {
color: var(--InputGroup-select-onFocused-color);
2019-12-06 09:58:08 +08:00
}
2019-04-30 11:11:25 +08:00
.#{$ns}Select-arrow {
color: var(--InputGroup-select-onFocused-arrowColor);
2019-12-06 09:58:08 +08:00
}
2019-08-12 21:14:33 +08:00
2019-12-06 09:58:08 +08:00
.#{$ns}InputGroup-addOn {
color: var(--primary);
2019-04-30 11:11:25 +08:00
}
2019-12-06 09:58:08 +08:00
}
2019-04-30 11:11:25 +08:00
}
.#{$ns}InputGroup:not(.is-inline) {
2019-12-06 09:58:08 +08:00
display: flex;
}