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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with
16 additions and
4 deletions
-
components/badge/__tests__/__snapshots__/demo-extend.test.ts.snap
-
components/badge/__tests__/__snapshots__/demo.test.ts.snap
-
components/badge/demo/ribbon.tsx
-
components/badge/style/index.ts
|
|
@ -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" |
|
|
|
|
|
@ -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" |
|
|
|
|
|
@ -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> |
|
|
|
|
|
@ -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`, |
|
|
|