validate langs card progress bar background color (#39)

This commit is contained in:
Martin
2026-02-24 12:13:04 +01:00
committed by GitHub
parent e474cb3449
commit e3b565152e
2 changed files with 4 additions and 6 deletions
+3 -5
View File
@@ -1,7 +1,7 @@
// @ts-check
import { Card } from "../common/Card.js";
import { getCardColors } from "../common/color.js";
import { fallbackColor, getCardColors } from "../common/color.js";
import { formatBytes } from "../common/fmt.js";
import { I18n } from "../common/I18n.js";
import { chunkArray, clampValue, lowercaseTrim } from "../common/ops.js";
@@ -252,9 +252,7 @@ const createProgressTextNode = ({
color,
width: progressWidth,
progress,
progressBarBackgroundColor: progBarBgColor
? `#${progBarBgColor}`
: "#ddd",
progressBarBackgroundColor: progBarBgColor,
delay: staggerDelay + 300,
})}
</g>
@@ -885,7 +883,7 @@ const renderTopLanguages = (topLangs, options = {}) => {
langs,
width,
totalLanguageSize,
prog_bar_bg_color,
fallbackColor(prog_bar_bg_color, "#ddd"),
stats_format,
);
}
+1 -1
View File
@@ -142,4 +142,4 @@ const getCardColors = ({
return { titleColor, iconColor, textColor, bgColor, borderColor, ringColor };
};
export { isValidHexColor, isValidGradient, getCardColors };
export { isValidHexColor, isValidGradient, getCardColors, fallbackColor };