Skip to content

Commit

Permalink
style: remove fixed height in badge.ribbon (ant-design#41661)
Browse files Browse the repository at this point in the history
* style: remove fixed height in badge.ribbon

* docs: update demo

* test: update snapshot
  • Loading branch information
MuxinFeng authored and RedJue committed Apr 25, 2023
1 parent ad5ac87 commit acc2154
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1964,7 +1964,11 @@ exports[`renders components/badge/demo/ribbon.tsx extend context correctly 1`] =
<span
class="ant-ribbon-text"
>
Hippies
<div>
Hippies
<br />
Happy
</div>
</span>
<div
class="ant-ribbon-corner"
Expand Down
6 changes: 5 additions & 1 deletion components/badge/__tests__/__snapshots__/demo.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1965,7 +1965,11 @@ exports[`renders components/badge/demo/ribbon.tsx correctly 1`] = `
<span
class="ant-ribbon-text"
>
Hippies
<div>
Hippies
<br />
Happy
</div>
</span>
<div
class="ant-ribbon-corner"
Expand Down
7 changes: 6 additions & 1 deletion components/badge/demo/ribbon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ const App: React.FC = () => (
and raises the spyglass.
</Card>
</Badge.Ribbon>
<Badge.Ribbon text="Hippies" color="pink">
<Badge.Ribbon text={
<div>
Hippies <br />
Happy
</div>
} color="pink">
<Card title="Pushes open the window" size="small">
and raises the spyglass.
</Card>
Expand Down
1 change: 0 additions & 1 deletion components/badge/style/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,6 @@ const genSharedBadgeStyle: GenerateStyle<BadgeToken> = (token: BadgeToken): CSSO
...resetComponent(token),
position: 'absolute',
top: marginXS,
height: badgeFontHeight,
padding: `0 ${token.paddingXS}px`,
color: token.colorPrimary,
lineHeight: `${badgeFontHeight}px`,
Expand Down

0 comments on commit acc2154

Please sign in to comment.