@import '../../style/themes/index'; @import '../../style/mixins/index'; @import '../../input/style/mixin'; @import '../../button/style/mixin'; @import '../../grid/style/mixin'; @import './mixin'; @form-prefix-cls: ~'@{ant-prefix}-form'; @form-component-height: @input-height-base; @form-component-max-height: @input-height-lg; @form-feedback-icon-size: @font-size-base; @form-help-margin-top: (@form-component-height - @form-component-max-height) / 2 + 2px; @form-explain-font-size: @font-size-base; // Extends additional 1px to fix precision issue. // https://github.com/ant-design/ant-design/issues/12803 // https://github.com/ant-design/ant-design/issues/8220 @form-explain-precision: 1px; @form-explain-height: floor(@form-explain-font-size * @line-height-base); .@{form-prefix-cls} { .reset-component; .reset-form; } .@{form-prefix-cls}-item-required::before { display: inline-block; margin-right: 4px; color: @label-required-color; font-size: @font-size-base; font-family: SimSun, sans-serif; line-height: 1; content: '*'; .@{form-prefix-cls}-hide-required-mark & { display: none; } } .@{form-prefix-cls}-item-label > label { color: @label-color; &::after { & when (@form-item-trailing-colon=true) { content: ':'; } & when not (@form-item-trailing-colon=true) { content: ' '; } position: relative; top: -0.5px; margin: 0 @form-item-label-colon-margin-right 0 @form-item-label-colon-margin-left; } &.@{form-prefix-cls}-item-no-colon::after { content: ' '; } } // Form items // You should wrap labels and controls in .@{form-prefix-cls}-item for optimum spacing .@{form-prefix-cls}-item { label { position: relative; > .@{iconfont-css-prefix} { font-size: @font-size-base; vertical-align: top; } } .reset-component; margin-bottom: @form-item-margin-bottom; vertical-align: top; &-control { position: relative; line-height: @form-component-max-height; .clearfix; } &-children { position: relative; } &-with-help { margin-bottom: max(0, @form-item-margin-bottom - @form-explain-height - @form-help-margin-top); } &-label { display: inline-block; overflow: hidden; line-height: @form-component-max-height - 0.0001px; white-space: nowrap; text-align: right; vertical-align: middle; &-left { text-align: left; } } .@{ant-prefix}-switch { margin: 2px 0 4px; } } .@{form-prefix-cls}-explain, .@{form-prefix-cls}-extra { clear: both; min-height: @form-explain-height + @form-explain-precision; margin-top: @form-help-margin-top; color: @text-color-secondary; font-size: @form-explain-font-size; line-height: @line-height-base; transition: color 0.3s @ease-out; // sync input color transition } .@{form-prefix-cls}-explain { margin-bottom: -@form-explain-precision; } .@{form-prefix-cls}-extra { padding-top: 4px; } .@{form-prefix-cls}-text { display: inline-block; padding-right: 8px; } .@{form-prefix-cls}-split { display: block; text-align: center; } form { .has-feedback { .@{ant-prefix}-input { padding-right: @input-padding-horizontal-base + @input-affix-width; } // https://github.com/ant-design/ant-design/issues/19884 .@{ant-prefix}-input-affix-wrapper { .@{ant-prefix}-input-suffix { padding-right: 18px; } .@{ant-prefix}-input { padding-right: @input-padding-horizontal-base + @input-affix-width * 2; } &.@{ant-prefix}-input-affix-wrapper-input-with-clear-btn { .@{ant-prefix}-input { padding-right: @input-padding-horizontal-base + @input-affix-width * 3; } } } // Fix overlapping between feedback icon and