From 4873d833e9858a9cf11ad62b3160986f2792eb46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=91=E6=B8=B8=E5=90=9B?= Date: Mon, 9 May 2022 19:39:23 +0800 Subject: [PATCH] fix(components): input textarea padding & label line-height (#7570) * fix(components): input textarea padding & label line-height * fix(components): form label top align by line-height --- packages/theme-chalk/src/form.scss | 12 +++++++----- packages/theme-chalk/src/input.scss | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/theme-chalk/src/form.scss b/packages/theme-chalk/src/form.scss index a8e972170d..1999b402b6 100644 --- a/packages/theme-chalk/src/form.scss +++ b/packages/theme-chalk/src/form.scss @@ -140,18 +140,20 @@ $form-item-label-top-margin-bottom: map.merge( @include e(label-wrap) { display: flex; - - .#{$namespace}-form-item__label { - display: inline-block; - } } @include e(label) { + display: inline-flex; + justify-content: flex-end; + align-items: flex-start; + flex: 0 0 auto; - text-align: right; font-size: getCssVar('form-label-font-size'); color: getCssVar('text-color', 'regular'); + + height: #{map.get($form-item-line-height, 'default')}; line-height: #{map.get($form-item-line-height, 'default')}; + padding: 0 12px 0 0; box-sizing: border-box; } diff --git a/packages/theme-chalk/src/input.scss b/packages/theme-chalk/src/input.scss index e2b476b227..71ca573906 100644 --- a/packages/theme-chalk/src/input.scss +++ b/packages/theme-chalk/src/input.scss @@ -43,7 +43,7 @@ position: relative; display: block; resize: vertical; - padding: 5px 15px; + padding: 5px map.get($input-padding-horizontal, 'default')-$border-width; line-height: 1.5; box-sizing: border-box; width: 100%;