diff --git a/components/date-picker/style/status.less b/components/date-picker/style/status.less index 35c3669535..be3adba330 100644 --- a/components/date-picker/style/status.less +++ b/components/date-picker/style/status.less @@ -2,7 +2,7 @@ @picker-prefix-cls: ~'@{ant-prefix}-picker'; -.status-color( +.picker-status-color( @text-color: @input-color; @border-color: @input-border-color; @background-color: @input-bg; @@ -29,11 +29,11 @@ .@{picker-prefix-cls} { &-status-error { - .status-color(@error-color, @error-color, @input-bg, @error-color-hover, @error-color-outline); + .picker-status-color(@error-color, @error-color, @input-bg, @error-color-hover, @error-color-outline); } &-status-warning { - .status-color(@warning-color, @warning-color, @input-bg, @warning-color-hover, @warning-color-outline); + .picker-status-color(@warning-color, @warning-color, @input-bg, @warning-color-hover, @warning-color-outline); } &-status-validating { diff --git a/components/input-number/style/status.less b/components/input-number/style/status.less index 717f81e86b..df6255880c 100644 --- a/components/input-number/style/status.less +++ b/components/input-number/style/status.less @@ -1,4 +1,4 @@ -@import '../../input/style/status'; +@import '../../input/style/mixin'; @input-number-prefix-cls: ~'@{ant-prefix}-input-number'; diff --git a/components/input/style/mixin.less b/components/input/style/mixin.less index 60299decb4..d0116d81f1 100644 --- a/components/input/style/mixin.less +++ b/components/input/style/mixin.less @@ -422,3 +422,53 @@ } } } + +.status-color( + @prefix-cls: @input-prefix-cls; + @text-color: @input-color; + @border-color: @input-border-color; + @background-color: @input-bg; + @hoverBorderColor: @primary-color-hover; + @outlineColor: @primary-color-outline; +) { + &:not(.@{prefix-cls}-disabled):not(.@{prefix-cls}-borderless).@{prefix-cls} { + &, + &:hover { + background: @background-color; + border-color: @border-color; + } + + &:focus, + &-focused { + .active(@text-color, @hoverBorderColor, @outlineColor); + } + } +} + +.status-color-common( + @prefix-cls: @input-prefix-cls; + @text-color: @input-color; + @border-color: @input-border-color; + @background-color: @input-bg; + @hoverBorderColor: @primary-color-hover; + @outlineColor: @primary-color-outline; +) { + .@{prefix-cls}-feedback-icon { + color: @text-color; + } + + .@{prefix-cls}-prefix { + color: @text-color; + } +} + +.group-status-color( + @prefix-cls: @input-prefix-cls; + @text-color: @input-color; + @border-color: @input-border-color; +) { + .@{prefix-cls}-group-addon { + color: @text-color; + border-color: @border-color; + } +} diff --git a/components/input/style/status.less b/components/input/style/status.less index cfeb21e411..f3279d83ae 100644 --- a/components/input/style/status.less +++ b/components/input/style/status.less @@ -2,56 +2,6 @@ @input-prefix-cls: ~'@{ant-prefix}-input'; -.status-color( - @prefix-cls: @input-prefix-cls; - @text-color: @input-color; - @border-color: @input-border-color; - @background-color: @input-bg; - @hoverBorderColor: @primary-color-hover; - @outlineColor: @primary-color-outline; -) { - &:not(.@{prefix-cls}-disabled):not(.@{prefix-cls}-borderless).@{prefix-cls} { - &, - &:hover { - background: @background-color; - border-color: @border-color; - } - - &:focus, - &-focused { - .active(@text-color, @hoverBorderColor, @outlineColor); - } - } -} - -.status-color-common( - @prefix-cls: @input-prefix-cls; - @text-color: @input-color; - @border-color: @input-border-color; - @background-color: @input-bg; - @hoverBorderColor: @primary-color-hover; - @outlineColor: @primary-color-outline; -) { - .@{prefix-cls}-feedback-icon { - color: @text-color; - } - - .@{prefix-cls}-prefix { - color: @text-color; - } -} - -.group-status-color( - @prefix-cls: @input-prefix-cls; - @text-color: @input-color; - @border-color: @input-border-color; -) { - .@{prefix-cls}-group-addon { - color: @text-color; - border-color: @border-color; - } -} - @input-wrapper-cls: @input-prefix-cls, ~'@{input-prefix-cls}-affix-wrapper'; each(@input-wrapper-cls, { diff --git a/components/mentions/style/status.less b/components/mentions/style/status.less index 690e4e5c44..83cbb3ab8e 100644 --- a/components/mentions/style/status.less +++ b/components/mentions/style/status.less @@ -1,6 +1,7 @@ -@import '../../input/style/status'; +@import '../../input/style/mixin'; @mention-prefix-cls: ~'@{ant-prefix}-mentions'; +@input-prefix-cls: ~'@{ant-prefix}-input'; .@{mention-prefix-cls} { &-status-error { diff --git a/components/select/style/status.less b/components/select/style/status.less index 6d4952a3cf..cf528508d6 100644 --- a/components/select/style/status.less +++ b/components/select/style/status.less @@ -2,7 +2,7 @@ @select-prefix-cls: ~'@{ant-prefix}-select'; -.status-color( +.select-status-color( @text-color; @border-color; @background-color; @@ -28,11 +28,11 @@ .select-status-base(@prefix-cls) { .@{prefix-cls} { &-status-error { - .status-color(@error-color, @error-color, @select-background, @error-color-hover, @error-color-outline); + .select-status-color(@error-color, @error-color, @select-background, @error-color-hover, @error-color-outline); } &-status-warning { - .status-color(@warning-color, @warning-color, @input-bg, @warning-color-hover, @warning-color-outline); + .select-status-color(@warning-color, @warning-color, @input-bg, @warning-color-hover, @warning-color-outline); } &-status-success { diff --git a/package.json b/package.json index 2405168d82..3ef1cad39d 100644 --- a/package.json +++ b/package.json @@ -312,7 +312,7 @@ }, { "path": "./dist/antd.variable.min.css", - "maxSize": "67 kB" + "maxSize": "66 kB" } ], "tnpm": {