From 9be92a5606efd190196bae2121a9d33922f9804e Mon Sep 17 00:00:00 2001 From: Bobban Rydh Date: Fri, 30 Oct 2026 23:23:11 +0100 Subject: [PATCH] =?UTF-8?q?Tags=20no=20longer=20get=20the=20status=20symbo?= =?UTF-8?q?ls=20(=E2=9C=93=20=E2=9C=95=20=E2=96=B2)=20when=20their=20autom?= =?UTF-8?q?atic=20colour=20is=20green,=20red=20or=20yellow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 5.5 --- web/src/styles.css | 14 +++++++------- web/src/utils/tags.ts | 9 ++++++--- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/web/src/styles.css b/web/src/styles.css index 28be7e8..1426abe 100644 --- a/web/src/styles.css +++ b/web/src/styles.css @@ -194,26 +194,26 @@ html[data-env] .navbar-vertical { background: color-mix(in srgb, currentColor 14%, transparent); } -/* ── Status badges carry a symbol as well as a colour, so red, amber and green never have to be told apart by colour alone. ── */ -.badge.bg-green-lt:not(:empty)::before, -.badge.bg-red-lt:not(:empty)::before, -.badge.bg-yellow-lt:not(:empty)::before { +/* ── Status badges carry a symbol as well as a colour, so red, amber and green never have to be told apart by colour alone. A tag (.tag-badge) is coloured by its name, not by status, so it has none. ── */ +.badge.bg-green-lt:not(.tag-badge, :empty)::before, +.badge.bg-red-lt:not(.tag-badge, :empty)::before, +.badge.bg-yellow-lt:not(.tag-badge, :empty)::before { display: inline-block; margin-right: 0.35em; font-weight: 700; } -.badge.bg-green-lt:not(:empty)::before { +.badge.bg-green-lt:not(.tag-badge, :empty)::before { content: "✓"; content: "✓" / ""; } -.badge.bg-red-lt:not(:empty)::before { +.badge.bg-red-lt:not(.tag-badge, :empty)::before { content: "✕"; content: "✕" / ""; } -.badge.bg-yellow-lt:not(:empty)::before { +.badge.bg-yellow-lt:not(.tag-badge, :empty)::before { content: "▲"; content: "▲" / ""; font-size: 0.75em; diff --git a/web/src/utils/tags.ts b/web/src/utils/tags.ts index 70c726f..cc2443a 100644 --- a/web/src/utils/tags.ts +++ b/web/src/utils/tags.ts @@ -16,11 +16,14 @@ export function normalizeTagInput(raw: string): string { return raw.trim().toLowerCase().replace(/\s+/g, "-"); } -/** How to draw a tag: its chosen colour if it has one (same tinted style as the other colour-customised badges), else the automatic one. */ +/** + * How to draw a tag: its chosen colour if it has one (same tinted style as the other colour-customised badges), else the automatic one. `tag-badge` keeps the + * status symbols (✓ ✕ ▲, styles.css) off it: a tag is coloured by its name, so a green or red one says nothing about how anything is doing. + */ export function tagBadge(tag: string, colors: Record): { className: string; style?: CSSProperties } { const color = colors[tag]; - if (!color) return { className: `badge ${tagColorClass(tag)}` }; - return { className: "badge", style: { backgroundColor: `${color}22`, color, border: `1px solid ${color}55` } }; + if (!color) return { className: `badge tag-badge ${tagColorClass(tag)}` }; + return { className: "badge tag-badge", style: { backgroundColor: `${color}22`, color, border: `1px solid ${color}55` } }; } // ─── Shared colour map ──────────────────────────────────────────────────────