Invert logo colour based on current theme #9

Manually merged
dalahast merged 1 commits from dynamic-logo-color into master 2021-01-22 16:37:19 +01:00

@ -1,7 +1,7 @@
<div class="ui container" id="navbar">
<div class="item brand" style="justify-content: space-between;">
<a href="/">
<img class="ui mini image" src="/img/logo.svg" alt="git.dotya.ml icon">
<img class="ui mini image" {{if .SignedUser}}{{if not (eq .SignedUser.Theme "arc-green" "42l-dark" "42l-light")}}style="filter: invert(.8);"{{end}}{{else if not (eq DefaultTheme "arc-green" "42l-dark" "42l-light")}}style="filter: invert(.8);"{{end}} src="/img/logo.svg" alt="git.dotya.ml icon">
dalahast marked this conversation as resolved
Review

Isn't there a dark/light parameter that could be used instead of an excplicit theme name? This is by all means ok for the current theme selection, but it would be better if this could be "set and forget".

Isn't there a dark/light parameter that could be used instead of an excplicit theme name? This is by all means ok for the current theme selection, but it would be better if this could be "set and forget".
Review

this would of course be better served as part of each theme but that would require maintaining a fork for each theme whereas this is not too elegant but still easier - at least as a hotfix.

this would of course be better served as part of each theme but that would require maintaining a fork for each theme whereas this is not too elegant but still easier - at least as a hotfix.
Review

Right, the themes are not expected to change for the foreseeable future so this is perfectly fine and indeed certainly better than maintaining a fork of each theme.

Right, the themes are not expected to change for the foreseeable future so this is perfectly fine and indeed certainly better than maintaining a fork of each theme.
Review

it is kind of hacky but for now it's still better than the other solution :D or at least quicker.
it might take its toll on the server, since it needs to evaluate DefaultTheme and .SignedUser.Theme for each request, but that would be a bigger problem under different loads..
it's good to know what potential bottlenecks are, though.

it is kind of hacky but for now it's still better than the other solution :D or at least quicker. it might take its toll on the server, since it needs to evaluate `DefaultTheme` and `.SignedUser.Theme` for each request, but that would be a bigger problem under different loads.. it's *good* to know what potential bottlenecks are, though.
</a>
<div class="ui basic icon button mobile-only" id="navbar-expand-toggle">
<i class="sidebar icon"></i>