From 6d8da5bdb9483d8fba443793737026a8514519c8 Mon Sep 17 00:00:00 2001 From: yoyo837 Date: Tue, 21 Apr 2020 15:11:00 +0800 Subject: [PATCH] improve @formItemMarginBottom --- components/form/style/index.less | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/components/form/style/index.less b/components/form/style/index.less index 6484956267..d0da104812 100644 --- a/components/form/style/index.less +++ b/components/form/style/index.less @@ -44,13 +44,22 @@ } } -.explainAndExtraDistance(@num) when (@num>=0) { +.explainAndExtraDistance(@num, @formItemMarginBottom) + when + (@num >= 0 and @formItemMarginBottom > 0) { padding-top: floor(@num); } -.explainAndExtraDistance(@num) when (@num<0) { + +.explainAndExtraDistance(@num, @formItemMarginBottom) + when + (@num < 0 and @formItemMarginBottom > 0) { margin-top: floor(@num); } +.explainAndExtraDistance(@num, @formItemMarginBottom) when (@formItemMarginBottom <= 0) { + display: none; +} + // ================================================================ // = Item = // ================================================================ @@ -155,7 +164,7 @@ &-extra { clear: both; min-height: @form-item-margin-bottom; - .explainAndExtraDistance((@form-item-margin-bottom - @form-font-height) / 2); + .explainAndExtraDistance((@form-item-margin-bottom - @form-font-height) / 2, @form-item-margin-bottom); color: @text-color-secondary; font-size: @font-size-base; line-height: @line-height-base;