Browse Source

style: remove fixed height in badge.ribbon (#41661)

* style: remove fixed height in badge.ribbon

* docs: update demo

* test: update snapshot
pull/41679/head
muxin 2 years ago
committed by GitHub
parent
commit
fc24f382fc
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      components/badge/__tests__/__snapshots__/demo-extend.test.ts.snap
  2. 6
      components/badge/__tests__/__snapshots__/demo.test.ts.snap
  3. 7
      components/badge/demo/ribbon.tsx
  4. 1
      components/badge/style/index.ts

6
components/badge/__tests__/__snapshots__/demo-extend.test.ts.snap

@ -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"

6
components/badge/__tests__/__snapshots__/demo.test.ts.snap

@ -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"

7
components/badge/demo/ribbon.tsx

@ -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>

1
components/badge/style/index.ts

@ -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`,

Loading…
Cancel
Save