aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorJeremy Davis <jeremy.davis@sonarsource.com>2024-10-08 17:25:44 +0200
committersonartech <sonartech@sonarsource.com>2024-10-09 20:02:45 +0000
commit015bf97ed90c1918db1f31911ae910af6dad8b3d (patch)
tree79e13f7e947db5f07f21c12d814ec104ced8bcd6 /server
parentaef2ea10ecee8df9eadf3d3da4e63c06a9378b8b (diff)
downloadsonarqube-015bf97ed90c1918db1f31911ae910af6dad8b3d.tar.gz
sonarqube-015bf97ed90c1918db1f31911ae910af6dad8b3d.zip
SONAR-23138 Fix counter contrast
Diffstat (limited to 'server')
-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(