From 5b29913174a244637549d79cf8c51f33c821cc4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AA=97=E4=BD=A0=E6=98=AF=E5=B0=8F=E7=8C=AB=E5=92=AA?= Date: Sat, 21 Dec 2019 22:01:47 +0800 Subject: [PATCH] refactor(Button): base style use flex (#20300) * improvement(Button): base style use flex * remove unnecessary style * add vertical-align * fix style lint order * remove vertical-align and improve global line-height * change line-height-base * update form debug demo --- .../__tests__/__snapshots__/demo.test.js.snap | 165 ++++++++++++++++++ components/auto-complete/demo/form-debug.md | 13 +- components/button/style/mixin.less | 5 +- components/style/themes/default.less | 3 +- 4 files changed, 182 insertions(+), 4 deletions(-) diff --git a/components/auto-complete/__tests__/__snapshots__/demo.test.js.snap b/components/auto-complete/__tests__/__snapshots__/demo.test.js.snap index 83b3cb367b..d01290fe28 100644 --- a/components/auto-complete/__tests__/__snapshots__/demo.test.js.snap +++ b/components/auto-complete/__tests__/__snapshots__/demo.test.js.snap @@ -747,6 +747,171 @@ exports[`renders ./components/auto-complete/demo/form-debug.md correctly 1`] = ` +
+
+ +
+
+
+ +
+
+ + + + +
+ +
+ + +
+
+
+
`; diff --git a/components/auto-complete/demo/form-debug.md b/components/auto-complete/demo/form-debug.md index 16375b4efa..700ec5ed2b 100644 --- a/components/auto-complete/demo/form-debug.md +++ b/components/auto-complete/demo/form-debug.md @@ -7,7 +7,7 @@ debug: true --- ```jsx -import { Input, AutoComplete, Form, TreeSelect } from 'antd'; +import { Input, AutoComplete, Form, TreeSelect, Button } from 'antd'; import { SearchOutlined } from '@ant-design/icons'; const formItemLayout = { @@ -56,6 +56,17 @@ ReactDOM.render( + + + + + + + + + , mountNode, ); diff --git a/components/button/style/mixin.less b/components/button/style/mixin.less index aa0ac3f3c6..29200db1e5 100644 --- a/components/button/style/mixin.less +++ b/components/button/style/mixin.less @@ -179,10 +179,11 @@ // -------------------------------------------------- .btn() { position: relative; - display: inline-block; + display: inline-flex; + align-items: center; + justify-content: center; font-weight: @btn-font-weight; white-space: nowrap; - text-align: center; background-image: none; border: @btn-border-width @btn-border-style transparent; box-shadow: @btn-shadow; diff --git a/components/style/themes/default.less b/components/style/themes/default.less index 666d45029d..b0acfaee06 100644 --- a/components/style/themes/default.less +++ b/components/style/themes/default.less @@ -68,7 +68,8 @@ @heading-2-size: ceil(@font-size-base * 2.14); @heading-3-size: ceil(@font-size-base * 1.71); @heading-4-size: ceil(@font-size-base * 1.42); -@line-height-base: 1.5; +// https://github.com/ant-design/ant-design/issues/20210 +@line-height-base: 1.5715; @border-radius-base: 2px; // vertical paddings