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:
1 parent
7e625e7f42
commit
9be92a5606
2 files changed
+13
-10
No files matched your search
+7
-7
@@ -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;
|
||||
|
||||
@@ -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<string, string>): { 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 ──────────────────────────────────────────────────────
|
||||
|
||||
Reference in new issue
Block a user