aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/design-system/src/components/Badge.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-web/design-system/src/components/Badge.tsx')
-rw-r--r--server/sonar-web/design-system/src/components/Badge.tsx10
1 files changed, 9 insertions, 1 deletions
diff --git a/server/sonar-web/design-system/src/components/Badge.tsx b/server/sonar-web/design-system/src/components/Badge.tsx
index 1746a417d0c..a88c457b4e6 100644
--- a/server/sonar-web/design-system/src/components/Badge.tsx
+++ b/server/sonar-web/design-system/src/components/Badge.tsx
@@ -38,6 +38,14 @@ interface BadgeProps extends React.PropsWithChildren {
variant?: BadgeVariant;
}
+function getColor(variantInfo: ThemeColors) {
+ if (variantInfo === 'badgeCounterFailed') {
+ return 'var(--echoes-color-text-danger-bold)';
+ }
+
+ return themeContrast(variantInfo);
+}
+
export function Badge({ className, children, title, variant = 'default' }: BadgeProps) {
const commonProps = {
'aria-label': title,
@@ -87,7 +95,7 @@ const StyledCounter = styled.span<{
${tw`sw-items-center sw-justify-center`};
${tw`sw-rounded-pill`};
- color: ${({ variantInfo }) => themeContrast(variantInfo)};
+ color: ${({ variantInfo }) => getColor(variantInfo)};
background-color: ${({ variantInfo }) => themeColor(variantInfo)};
border: ${({ variantInfo }) =>
themeBorder(