diff --git a/components/form/style/index.less b/components/form/style/index.less index 97d41fcfe..b48283774 100644 --- a/components/form/style/index.less +++ b/components/form/style/index.less @@ -464,7 +464,8 @@ form { } } -.has-error { +.has-error, +&-has-error { .form-control-validation(@error-color; @error-color; @form-error-input-bg;); &.has-feedback .@{form-prefix-cls}-item-children-icon { @@ -473,15 +474,12 @@ form { } //select - .@{ant-prefix}-select { - &-selection { - border-color: @error-color; - &:hover { - border-color: @error-color; - } + .@{ant-prefix}-select:not(.@{ant-prefix}-select-borderless) { + .@{ant-prefix}-select-selector { + border-color: @error-color !important; } - &-open .@{ant-prefix}-select-selection, - &-focused .@{ant-prefix}-select-selection { + &.@{ant-prefix}-select-open .@{ant-prefix}-select-selector, + &.@{ant-prefix}-select-focused .@{ant-prefix}-select-selector { .active(@error-color); } } @@ -499,15 +497,6 @@ form { } } - // arrow and icon - .@{ant-prefix}-calendar-picker-icon::after, - .@{ant-prefix}-time-picker-icon::after, - .@{ant-prefix}-picker-icon::after, - .@{ant-prefix}-select-arrow, - .@{ant-prefix}-cascader-picker-arrow { - color: @error-color; - } - //input-number, timepicker .@{ant-prefix}-input-number, .@{ant-prefix}-time-picker-input { diff --git a/components/form/style/mixin.less b/components/form/style/mixin.less index 34fc912ee..ae932699d 100644 --- a/components/form/style/mixin.less +++ b/components/form/style/mixin.less @@ -6,7 +6,8 @@ color: @text-color; } // 输入框的不同校验状态 - .@{ant-prefix}-input { + .@{ant-prefix}-input, + .@{ant-prefix}-input-affix-wrapper { &, &:hover { background-color: @background-color; diff --git a/components/input/style/affix.less b/components/input/style/affix.less new file mode 100644 index 000000000..6254c54f2 --- /dev/null +++ b/components/input/style/affix.less @@ -0,0 +1,48 @@ +@import './index'; +@import './mixin'; + +@input-affix-margin: 4px; + +.@{ant-prefix}-input { + &-affix-wrapper { + .input(); + display: inline-flex; + + &-disabled { + .@{ant-prefix}-input[disabled] { + background: transparent; + } + } + + > input.@{ant-prefix}-input { + padding: 0; + border: none; + outline: none; + + &:focus { + box-shadow: none; + } + } + + &::before { + width: 0; + visibility: hidden; + content: '\a0'; + } + } + + &-prefix, + &-suffix { + display: flex; + flex: none; + align-items: center; + } + + &-prefix { + margin-right: @input-affix-margin; + } + + &-suffix { + margin-left: @input-affix-margin; + } +} diff --git a/components/input/style/index.less b/components/input/style/index.less index c41058460..fb8c61932 100644 --- a/components/input/style/index.less +++ b/components/input/style/index.less @@ -1,5 +1,6 @@ @import '../../style/themes/index'; @import '../../style/mixins/index'; +@import './affix'; @import './mixin'; // Input styles