From dfae16f09fc53853f33d1ceab0f33c77583516e2 Mon Sep 17 00:00:00 2001 From: liuxy0551 Date: Tue, 17 Dec 2024 20:50:28 +0800 Subject: [PATCH] fix: #130 button only icon --- components/button/demo/basic.md | 3 ++- components/button/demo/icon.md | 9 +++++++++ theme/dt-theme/default/button.less | 27 +++++++++++++++++++-------- 3 files changed, 30 insertions(+), 9 deletions(-) diff --git a/components/button/demo/basic.md b/components/button/demo/basic.md index dd893e45..149f706e 100755 --- a/components/button/demo/basic.md +++ b/components/button/demo/basic.md @@ -18,7 +18,8 @@ ReactDOM.render( - + + , mountNode, ); diff --git a/components/button/demo/icon.md b/components/button/demo/icon.md index c587d866..01f517ad 100644 --- a/components/button/demo/icon.md +++ b/components/button/demo/icon.md @@ -36,6 +36,15 @@ ReactDOM.render(
+ + + + + + + +
+ diff --git a/theme/dt-theme/default/button.less b/theme/dt-theme/default/button.less index 86bbd315..4bca7452 100644 --- a/theme/dt-theme/default/button.less +++ b/theme/dt-theme/default/button.less @@ -242,16 +242,27 @@ } } -.ant-btn-icon-only { - padding: 0; +.ant-btn.ant-btn-icon-only { width: 48px; height: 32px; - background: @blue; - color: @white; - .anticon-search { - width: 14px; - height: 14px; - margin-left: 7px; + >.anticon { + font-size: 16px; + } +} + +.ant-btn-lg.ant-btn-icon-only { + width: 50px; + height: 34px; + >.anticon { + font-size: 18px; + } +} + +.ant-btn-sm.ant-btn-icon-only { + width: 28px; + height: 24px; + >.anticon { + font-size: 12px; } }