From 6bd83feafed8da6ce574684470dccd2a5d8ef5b7 Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Thu, 4 Jan 2024 15:38:53 +0100 Subject: [PATCH] Update up-down icons --- nummi/history/templates/history/plot.html | 2 +- nummi/history/templatetags/history_extras.py | 6 +++--- nummi/main/static/main/css/main.css | 9 +++++++-- nummi/main/static/main/css/plot.css | 9 +++++++-- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/nummi/history/templates/history/plot.html b/nummi/history/templates/history/plot.html index b96e510..6ef6804 100644 --- a/nummi/history/templates/history/plot.html +++ b/nummi/history/templates/history/plot.html @@ -70,7 +70,7 @@ {% endif %} {% if m %} {% up_down_icon m.sum %} {% else %} diff --git a/nummi/history/templatetags/history_extras.py b/nummi/history/templatetags/history_extras.py index 0b02d24..eaefea3 100644 --- a/nummi/history/templatetags/history_extras.py +++ b/nummi/history/templatetags/history_extras.py @@ -30,11 +30,11 @@ def empty_calendar_cells_end(n): @register.simple_tag def up_down_icon(val): if val > 0: - return remix("arrow-up-s", "green w") + return remix("arrow-up-s", "green") elif val < 0: - return remix("arrow-down-s", "red w") + return remix("arrow-down-s", "red") - return "" + return remix("equal", "white") @register.simple_tag diff --git a/nummi/main/static/main/css/main.css b/nummi/main/static/main/css/main.css index b05218a..35dd9d1 100644 --- a/nummi/main/static/main/css/main.css +++ b/nummi/main/static/main/css/main.css @@ -232,14 +232,19 @@ footer { font-weight: normal; &.green, - &.red { - color: white; + &.red, + &.white { + color: var(--bg); &.green { background: var(--green); } &.red { background: var(--red); } + &.white { + background: var(--bg-01); + color: var(--text); + } border-radius: var(--radius); height: 1.5rem; width: 1.5rem; diff --git a/nummi/main/static/main/css/plot.css b/nummi/main/static/main/css/plot.css index 3f7cf6b..9a2bc7a 100644 --- a/nummi/main/static/main/css/plot.css +++ b/nummi/main/static/main/css/plot.css @@ -101,11 +101,16 @@ table.full-width col.bar { td { text-align: center; + background-color: color-mix( + in hsl, + var(--td-bg, var(--bg)) var(--opacity), + var(--bg) + ); &.p { - color: var(--green); + --td-bg: var(--green); } &.m { - color: var(--red); + --td-bg: var(--red); } } }