feat(lored,labels): pass label colors via css variable

This commit is contained in:
Guz
2025-10-07 15:06:13 -03:00
parent ea20ef698d
commit 026bc664e8
2 changed files with 23 additions and 10 deletions

View File

@@ -152,7 +152,7 @@ func (ut *RenderUtils) renderLabelWithTag(label *issues_model.Label, tagName, ta
if labelScope == "" {
// Regular label
return htmlutil.HTMLFormat(`<%s %s class="ui label %s" style="color: %s !important; background-color: %s !important;" data-tooltip-content title="%s"><span class="gt-ellipsis">%s</span></%s>`,
return htmlutil.HTMLFormat(`<%s %s class="ui label %s" style="--custom-color-label-text: %s; --custom-color-label-bg: %s;" data-tooltip-content title="%s"><span class="gt-ellipsis">%s</span></%s>`,
tagName, tagAttrs, extraCSSClasses, textColor, label.Color, descriptionText, ut.RenderEmoji(label.Name), tagName)
}
@@ -189,8 +189,8 @@ func (ut *RenderUtils) renderLabelWithTag(label *issues_model.Label, tagName, ta
if label.ExclusiveOrder > 0 {
// <scope> | <label> | <order>
return htmlutil.HTMLFormat(`<%s %s class="ui label %s scope-parent" data-tooltip-content title="%s">`+
`<div class="ui label scope-left" style="color: %s !important; background-color: %s !important">%s</div>`+
`<div class="ui label scope-middle" style="color: %s !important; background-color: %s !important">%s</div>`+
`<div class="ui label scope-left" style="--custom-color-label-text: %s; --custom-color-label-bg: %s;">%s</div>`+
`<div class="ui label scope-middle" style="--custom-color-label-text: %s; --custom-color-label-bg: %s;">%s</div>`+
`<div class="ui label scope-right">%d</div>`+
`</%s>`,
tagName, tagAttrs,
@@ -203,8 +203,8 @@ func (ut *RenderUtils) renderLabelWithTag(label *issues_model.Label, tagName, ta
// <scope> | <label>
return htmlutil.HTMLFormat(`<%s %s class="ui label %s scope-parent" data-tooltip-content title="%s">`+
`<div class="ui label scope-left" style="color: %s !important; background-color: %s !important">%s</div>`+
`<div class="ui label scope-right" style="color: %s !important; background-color: %s !important">%s</div>`+
`<div class="ui label scope-left" style="--custom-color-label-text: %s; --custom-color-label-bg: %s;">%s</div>`+
`<div class="ui label scope-right" style="--custom-color-label-text: %s; --custom-color-label-bg: %s;">%s</div>`+
`</%s>`,
tagName, tagAttrs,
extraCSSClasses, descriptionText,