mirror of
https://github.com/tiennm99/github-readme-stats.git
synced 2026-07-17 08:17:48 +00:00
feat: added border_color option (#1000)
* feat: Allow customization of border color * docs: Update readme
This commit is contained in:
+1
-1
@@ -147,7 +147,7 @@ class Card {
|
||||
y="0.5"
|
||||
rx="${this.border_radius}"
|
||||
height="99%"
|
||||
stroke="#E4E2E2"
|
||||
stroke="${this.colors.borderColor}"
|
||||
width="${this.width - 1}"
|
||||
fill="${
|
||||
typeof this.colors.bgColor === "object"
|
||||
|
||||
+8
-1
@@ -115,10 +115,12 @@ function getCardColors({
|
||||
icon_color,
|
||||
bg_color,
|
||||
theme,
|
||||
border_color,
|
||||
fallbackTheme = "default",
|
||||
}) {
|
||||
const defaultTheme = themes[fallbackTheme];
|
||||
const selectedTheme = themes[theme] || defaultTheme;
|
||||
const defaultBorderColor = selectedTheme.border_color || defaultTheme.border_color;
|
||||
|
||||
// get the color provided by the user else the theme color
|
||||
// finally if both colors are invalid fallback to default theme
|
||||
@@ -139,7 +141,12 @@ function getCardColors({
|
||||
"#" + defaultTheme.bg_color,
|
||||
);
|
||||
|
||||
return { titleColor, iconColor, textColor, bgColor };
|
||||
const borderColor = fallbackColor(
|
||||
border_color || defaultBorderColor,
|
||||
"#" + defaultBorderColor,
|
||||
);
|
||||
|
||||
return { titleColor, iconColor, textColor, bgColor, borderColor };
|
||||
}
|
||||
|
||||
function wrapTextMultiline(text, width = 60, maxLines = 3) {
|
||||
|
||||
Reference in New Issue
Block a user