add classname support to buildCategoryLabel

set border-color to backgroundcolor
This commit is contained in:
Barış Soner Uşaklı
2023-01-09 14:12:15 -05:00
parent 8deb1ba4b4
commit c7c1ff6bea

View File

@@ -89,12 +89,12 @@ module.exports = function (utils, Benchpress, relative_path) {
return `<span class="icon d-inline-flex justify-content-center align-items-center align-middle ${rounded}" style="${generateCategoryBackground(category)} width:${size}; height: ${size}; font-size: ${parseInt(size, 10) / 2}px;">${category.icon ? `<i class="fa fa-fw ${category.icon}"></i>` : ''}</span>`;
}
function buildCategoryLabel(category) {
function buildCategoryLabel(category, className = '') {
if (!category) {
return '';
}
return `<span class="badge px-1" style="${generateCategoryBackground(category)}">
return `<span class="badge px-1 ${className}" style="${generateCategoryBackground(category)}">
${category.icon ? `<i class="fa fa-fw ${category.icon}"></i>` : ''}
${category.name}
</span>`;
@@ -108,6 +108,7 @@ module.exports = function (utils, Benchpress, relative_path) {
if (category.bgColor) {
style.push('background-color: ' + category.bgColor);
style.push(`border-color: ${category.bgColor}!important`);
}
if (category.color) {