fix: Button two Chinese chars (#45126)

This commit is contained in:
MadCcc 2023-09-27 20:17:40 +08:00 committed by GitHub
parent 05cc5f1254
commit 9f55e6c11a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 42 additions and 0 deletions

View File

@ -158,6 +158,20 @@ exports[`renders components/button/demo/chinese-chars-loading.tsx extend context
class="ant-space ant-space-horizontal ant-space-align-center ant-space-gap-row-small ant-space-gap-col-small"
style="flex-wrap: wrap;"
>
<div
class="ant-space-item"
>
<button
class="ant-btn ant-btn-default ant-btn-two-chinese-chars"
type="button"
>
<span>
<span>
部署
</span>
</span>
</button>
</div>
<div
class="ant-space-item"
>

View File

@ -154,6 +154,20 @@ exports[`renders components/button/demo/chinese-chars-loading.tsx correctly 1`]
class="ant-space ant-space-horizontal ant-space-align-center ant-space-gap-row-small ant-space-gap-col-small"
style="flex-wrap:wrap"
>
<div
class="ant-space-item"
>
<button
class="ant-btn ant-btn-default"
type="button"
>
<span>
<span>
部署
</span>
</span>
</button>
</div>
<div
class="ant-space-item"
>

View File

@ -9,6 +9,11 @@ const Text3 = () => 'Submit';
const App: React.FC = () => (
<Space wrap>
<Button>
<span>
<span></span>
</span>
</Button>
<Button loading></Button>
<Button loading>
<Text1 />

View File

@ -195,6 +195,15 @@ const genSharedButtonStyle: GenerateStyle<ButtonToken, CSSObject> = (token): CSS
...genFocusStyle(token),
},
[`&${componentCls}-two-chinese-chars::first-letter`]: {
letterSpacing: '0.34em',
},
[`&${componentCls}-two-chinese-chars > *:not(${iconCls})`]: {
marginInlineEnd: '-0.34em',
letterSpacing: '0.34em',
},
// make `btn-icon-only` not too narrow
[`&-icon-only${componentCls}-compact-item`]: {
flex: 'none',