Skip to content

Commit

Permalink
fix: #130 button only icon
Browse files Browse the repository at this point in the history
  • Loading branch information
liuxy0551 committed Dec 17, 2024
1 parent 3ff557c commit dfae16f
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 9 deletions.
3 changes: 2 additions & 1 deletion components/button/demo/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ ReactDOM.render(
<Button type="primary">一级按钮</Button>
<Button>二级按钮</Button>
<Button type="link">文字按钮</Button>
<Button icon={<SearchOutlined />} className="dt-btn-highlight"></Button>
<Button icon={<SearchOutlined />} className="dt-btn-highlight"></Button>
<Button size="small" icon={<SearchOutlined />}></Button>
</div>,
mountNode,
);
Expand Down
9 changes: 9 additions & 0 deletions components/button/demo/icon.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ ReactDOM.render(

<br/>

<Button size="large" type="primary" icon={<ReloadOutlined />}></Button>
<Button size="middle" type="primary" icon={<ReloadOutlined />}></Button>
<Button size="small" type="primary" icon={<ReloadOutlined />}></Button>
<Button size="large" icon={<ReloadOutlined />}></Button>
<Button size="middle" icon={<ReloadOutlined />}></Button>
<Button size="small" icon={<ReloadOutlined />}></Button>

<br/>

<Button className="dt-btn-custom-icon" style={{ color: "#1D78FF" }} size="large" icon={<PlusSquareOutlined />}>一级按钮</Button>
<Button className="dt-btn-custom-icon" size="middle" icon={<PlusSquareOutlined />}>一级按钮</Button>
<Button className="dt-btn-custom-icon" size="small" icon={<PlusSquareOutlined />}>一级按钮</Button>
Expand Down
27 changes: 19 additions & 8 deletions theme/dt-theme/default/button.less
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down

0 comments on commit dfae16f

Please sign in to comment.