From 2a9a4709d16020457e3b913c196ebcbb814c48aa Mon Sep 17 00:00:00 2001 From: mister-ideas <36502095+mister-ideas@users.noreply.github.com> Date: Wed, 21 Oct 2026 10:36:57 +0200 Subject: [PATCH] Feature/tint the whole changed figure instead of coloring its digits --- apps/client/src/styles.scss | 34 +++++++++++----- libs/ui/src/lib/value/value.component.html | 46 +++++++++++----------- libs/ui/src/lib/value/value.component.ts | 6 ++- 3 files changed, 52 insertions(+), 34 deletions(-) diff --git a/apps/client/src/styles.scss b/apps/client/src/styles.scss index 6561cd7a44..15578ea576 100644 --- a/apps/client/src/styles.scss +++ b/apps/client/src/styles.scss @@ -503,28 +503,42 @@ ngx-skeleton-loader { } } -// Highlight of a changed value: the number briefly takes the colour of the -// change (green up, red down) and fades back to its normal colour +// Highlight of a changed value: the whole figure (sign, number and unit) gets +// a soft background tint in the direction of the change, which fades out. The +// text colors stay untouched, so the persistent colors of the sign (positive +// / negative) and the temporary highlight (value just changed) never mix up @keyframes gf-flash-up { - 0%, - 35% { - color: var(--bs-success, #198754); + from { + background-color: color-mix( + in srgb, + var(--bs-success, #198754) 30%, + transparent + ); } } @keyframes gf-flash-down { - 0%, - 35% { - color: var(--bs-danger, #dc3545); + from { + background-color: color-mix( + in srgb, + var(--bs-danger, #dc3545) 30%, + transparent + ); } } +.gf-flash-up, +.gf-flash-down { + border-radius: 0.25rem; + box-shadow: 0 0 0 0.125rem transparent; +} + .gf-flash-up { - animation: gf-flash-up 1.8s ease-out; + animation: gf-flash-up 1.2s ease-out; } .gf-flash-down { - animation: gf-flash-down 1.8s ease-out; + animation: gf-flash-down 1.2s ease-out; } @media (prefers-reduced-motion: reduce) { diff --git a/libs/ui/src/lib/value/value.component.html b/libs/ui/src/lib/value/value.component.html index 066599a5d9..c9441b1536 100644 --- a/libs/ui/src/lib/value/value.component.html +++ b/libs/ui/src/lib/value/value.component.html @@ -42,31 +42,33 @@ [class.justify-content-end]="position === 'end'" > @if (isNumber || value === null) { - @if (colorizeSign && !useAbsoluteValue && value !== null) { - @if (+value > 0) { -