Browse Source

fix: fix Badge Wave borderColor error (#39182)

* fix: fix Badge borderColor error

* update demo

* fix

* update demo

* fix

* fix
pull/39192/head
lijianan 2 years ago
committed by GitHub
parent
commit
eb77c5a7e6
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      components/badge/__tests__/__snapshots__/demo-extend.test.ts.snap
  2. 8
      components/badge/__tests__/__snapshots__/demo.test.ts.snap
  3. 1
      components/badge/index.tsx
  4. 5
      components/badge/style/index.tsx

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

@ -549,7 +549,7 @@ Array [
>
<span
class="ant-badge-status-dot"
style="background:#f50"
style="color:#f50;background:#f50"
/>
<span
class="ant-badge-status-text"
@ -567,7 +567,7 @@ Array [
>
<span
class="ant-badge-status-dot"
style="background:rgb(45, 183, 245)"
style="color:rgb(45, 183, 245);background:rgb(45, 183, 245)"
/>
<span
class="ant-badge-status-text"
@ -585,7 +585,7 @@ Array [
>
<span
class="ant-badge-status-dot"
style="background:hsl(102, 53%, 61%)"
style="color:hsl(102, 53%, 61%);background:hsl(102, 53%, 61%)"
/>
<span
class="ant-badge-status-text"
@ -602,7 +602,7 @@ Array [
>
<span
class="ant-badge-status-dot"
style="background:hwb(205 6% 9%)"
style="color:hwb(205 6% 9%);background:hwb(205 6% 9%)"
/>
<span
class="ant-badge-status-text"

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

@ -549,7 +549,7 @@ Array [
>
<span
class="ant-badge-status-dot"
style="background:#f50"
style="color:#f50;background:#f50"
/>
<span
class="ant-badge-status-text"
@ -567,7 +567,7 @@ Array [
>
<span
class="ant-badge-status-dot"
style="background:rgb(45, 183, 245)"
style="color:rgb(45, 183, 245);background:rgb(45, 183, 245)"
/>
<span
class="ant-badge-status-text"
@ -585,7 +585,7 @@ Array [
>
<span
class="ant-badge-status-dot"
style="background:hsl(102, 53%, 61%)"
style="color:hsl(102, 53%, 61%);background:hsl(102, 53%, 61%)"
/>
<span
class="ant-badge-status-text"
@ -602,7 +602,7 @@ Array [
>
<span
class="ant-badge-status-dot"
style="background:hwb(205 6% 9%)"
style="color:hwb(205 6% 9%);background:hwb(205 6% 9%)"
/>
<span
class="ant-badge-status-text"

1
components/badge/index.tsx

@ -153,6 +153,7 @@ const Badge: CompoundedComponent = ({
const statusStyle: React.CSSProperties = {};
if (color && !isPresetColor(color)) {
statusStyle.color = color;
statusStyle.background = color;
}

5
components/badge/style/index.tsx

@ -185,6 +185,7 @@ const genSharedBadgeStyle: GenerateStyle<BadgeToken> = (token: BadgeToken): CSSO
},
[`${componentCls}-status-processing`]: {
position: 'relative',
color: token.colorPrimary,
backgroundColor: token.colorPrimary,
'&::after': {
@ -193,7 +194,9 @@ const genSharedBadgeStyle: GenerateStyle<BadgeToken> = (token: BadgeToken): CSSO
insetInlineStart: 0,
width: '100%',
height: '100%',
border: `${badgeShadowSize}px solid ${token.colorPrimary}`,
borderWidth: badgeShadowSize,
borderStyle: 'solid',
borderColor: 'inherit',
borderRadius: '50%',
animationName: antStatusProcessing,
animationDuration: token.badgeProcessingDuration,

Loading…
Cancel
Save