diff options
author | Brecht Van Lommel <brecht@blender.org> | 2023-03-13 01:46:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-13 08:46:13 +0800 |
commit | a8e13e64da7f9dc6176365e6b9295981af5d81ea (patch) | |
tree | e087e6eb51ca0afd5c46ec257ddf7cfcf0661214 /modules/templates | |
parent | 43c136200a181858cf36a0a876cb6609aa804120 (diff) | |
download | gitea-a8e13e64da7f9dc6176365e6b9295981af5d81ea.tar.gz gitea-a8e13e64da7f9dc6176365e6b9295981af5d81ea.zip |
Scoped label display and documentation tweaks (#23430)
* Fix scoped label left and right part breaking across lines.
* Remove slanted divider in scoped label display, make it straight.
After using this for a while, this feels more visually noisy than
helpful.
* Reduce contrast between scope and item to reduce probability of
unreadable text on background.
* Change documentation to remove mention of non-exclusive scoped labels.
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'modules/templates')
-rw-r--r-- | modules/templates/helper.go | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/modules/templates/helper.go b/modules/templates/helper.go index 19893c7c9d..822bbbd9b1 100644 --- a/modules/templates/helper.go +++ b/modules/templates/helper.go @@ -834,7 +834,7 @@ func RenderLabel(ctx context.Context, label *issues_model.Label) string { // Make scope and item background colors slightly darker and lighter respectively. // More contrast needed with higher luminance, empirically tweaked. luminance := (0.299*r + 0.587*g + 0.114*b) / 255 - contrast := 0.01 + luminance*0.06 + contrast := 0.01 + luminance*0.03 // Ensure we add the same amount of contrast also near 0 and 1. darken := contrast + math.Max(luminance+contrast-1.0, 0.0) lighten := contrast + math.Max(contrast-luminance, 0.0) @@ -859,12 +859,10 @@ func RenderLabel(ctx context.Context, label *issues_model.Label) string { return fmt.Sprintf("<span class='ui label scope-parent' 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='background: linear-gradient(-80deg, %s 48%%, %s 52%% 0%%);'> </div>"+ "<div class='ui label scope-right' style='color: %s !important; background-color: %s !important''>%s</div>"+ "</span>", description, textColor, scopeColor, scopeText, - itemColor, scopeColor, textColor, itemColor, itemText) } |