import { ICON_PALETTES, type IconPalette } from "yt-dlp-transcript-common/lib/brand"; import { siteIconPalette } from "yt-dlp-transcript-common/lib/brandIconFiles"; import type { BrandMarkPalette } from "yt-dlp-transcript-common/components/BrandMark"; import { currentSite } from "./site"; import { instanceMode } from "./mode"; // The palette this build's icons are drawn in. The hub is the family's own // tool, so it wears the parent mark — achromatic, like the homepage and the // editor. Every archive site is lit with its own accent's on-dark value. // Server-only, like currentSite(). export function iconPalette(): IconPalette { return instanceMode() === "hub" ? ICON_PALETTES.archilyzer : siteIconPalette(currentSite().accent); } // The header mark's palette. On a site it is the icon's ink tile, its lit line // the accent in force — `--brand-mark` is that accent's on-dark value (the // tile is always ink), the same the favicon wears. tokens.css defines `--brand-mark` on every page (a Signal default on // `:root`, then each `html[data-accent]` rule); the `--brand` fallback is only a // guard. The hub's mark is the parent mark and does not follow. export function headerMarkPalette(): BrandMarkPalette { return instanceMode() === "hub" ? ICON_PALETTES.archilyzer : { ...ICON_PALETTES.child, lit: "var(--brand-mark, var(--brand))" }; }