Tags no longer get the status symbols (✓ ✕ ▲) when their automatic colour is green, red or yellow

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-10-30 23:23:11 +01:00
1 parent 7e625e7f42
commit 9be92a5606
2 files changed
+13 -10

No files matched your search

+7 -7
View File
@@ -194,26 +194,26 @@ html[data-env] .navbar-vertical {
background: color-mix(in srgb, currentColor 14%, transparent); 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. ── */ /* ── 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(:empty)::before, .badge.bg-green-lt:not(.tag-badge, :empty)::before,
.badge.bg-red-lt:not(:empty)::before, .badge.bg-red-lt:not(.tag-badge, :empty)::before,
.badge.bg-yellow-lt:not(:empty)::before { .badge.bg-yellow-lt:not(.tag-badge, :empty)::before {
display: inline-block; display: inline-block;
margin-right: 0.35em; margin-right: 0.35em;
font-weight: 700; font-weight: 700;
} }
.badge.bg-green-lt:not(:empty)::before { .badge.bg-green-lt:not(.tag-badge, :empty)::before {
content: "✓"; content: "✓";
content: "✓" / ""; content: "✓" / "";
} }
.badge.bg-red-lt:not(:empty)::before { .badge.bg-red-lt:not(.tag-badge, :empty)::before {
content: "✕"; content: "✕";
content: "✕" / ""; content: "✕" / "";
} }
.badge.bg-yellow-lt:not(:empty)::before { .badge.bg-yellow-lt:not(.tag-badge, :empty)::before {
content: "▲"; content: "▲";
content: "▲" / ""; content: "▲" / "";
font-size: 0.75em; font-size: 0.75em;
+6 -3
View File
@@ -16,11 +16,14 @@ export function normalizeTagInput(raw: string): string {
return raw.trim().toLowerCase().replace(/\s+/g, "-"); 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<string, string>): { className: string; style?: CSSProperties } { export function tagBadge(tag: string, colors: Record<string, string>): { className: string; style?: CSSProperties } {
const color = colors[tag]; const color = colors[tag];
if (!color) return { className: `badge ${tagColorClass(tag)}` }; if (!color) return { className: `badge tag-badge ${tagColorClass(tag)}` };
return { className: "badge", style: { backgroundColor: `${color}22`, color, border: `1px solid ${color}55` } }; return { className: "badge tag-badge", style: { backgroundColor: `${color}22`, color, border: `1px solid ${color}55` } };
} }
// ─── Shared colour map ────────────────────────────────────────────────────── // ─── Shared colour map ──────────────────────────────────────────────────────