mirror of
https://github.com/konpa/devicon.git
synced 2025-08-07 07:06:59 +02:00
Fix css color not including the aliases
This commit is contained in:
@@ -101,13 +101,22 @@ function createColorsCSS(deviconJson) {
|
|||||||
font: fonts
|
font: fonts
|
||||||
},
|
},
|
||||||
color,
|
color,
|
||||||
|
aliases
|
||||||
} = fontObj;
|
} = fontObj;
|
||||||
|
|
||||||
if (fonts.length === 0 || typeof(color) !== "string") {
|
if (fonts.length === 0 || typeof(color) !== "string") {
|
||||||
console.log(`This object doesn't have a font or a color: ${name}`);
|
console.log(`This object doesn't have a font or a color: ${name}`);
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// process the icons in the font attr
|
||||||
let cssClasses = fonts.map(font => `.devicon-${name}-${font}.colored`);
|
let cssClasses = fonts.map(font => `.devicon-${name}-${font}.colored`);
|
||||||
|
|
||||||
|
// process the icons in the aliases attr
|
||||||
|
aliases.forEach(aliasObj => {
|
||||||
|
cssClasses.push(`.devicon-${name}-${aliasObj["alias"]}.colored`);
|
||||||
|
});
|
||||||
|
|
||||||
return `${cssClasses.join(",")}{color: ${color}}`;
|
return `${cssClasses.join(",")}{color: ${color}}`;
|
||||||
}).join(" ");
|
}).join(" ");
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user