diff options
author | Giteabot <teabot@gitea.io> | 2023-03-14 19:58:38 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-15 07:58:38 +0800 |
commit | c698a6fc5db489fa60784c6d498e810975056229 (patch) | |
tree | 6a646c8aaab4f7d808084f7abc3c1b2ea2797f2d /modules | |
parent | e5a51eca45ff6e6ef600081b4046f0eb73dd48da (diff) | |
download | gitea-c698a6fc5db489fa60784c6d498e810975056229.tar.gz gitea-c698a6fc5db489fa60784c6d498e810975056229.zip |
Scoped label display and documentation tweaks (#23430) (#23433)
Backport #23430 by @brechtvl
* 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: Brecht Van Lommel <brecht@blender.org>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Diffstat (limited to 'modules')
-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) } |