From 5a18facc4fefb98f07945feb5c8bb744f6d5eba2 Mon Sep 17 00:00:00 2001 From: "naps62-yolo (agent)" Date: Wed, 11 Nov 2026 21:14:23 +0000 Subject: [PATCH] refactor(web): move the stylesheet into Tailwind utilities (#281) --- web/scripts/check-tokens.mjs | 6 +- web/src/App.tsx | 82 +- web/src/buckets.tsx | 100 +- web/src/components.css | 2343 +--------------------------------- web/src/detail.tsx | 65 +- web/src/icons.tsx | 23 +- web/src/look.ts | 372 ++++++ web/src/parts.tsx | 28 +- web/src/rows.tsx | 17 +- web/src/style.css | 72 +- web/src/subs-panel.tsx | 107 +- web/src/ui.tsx | 474 +++++-- web/src/views/Library.tsx | 74 +- web/src/views/Movie.tsx | 59 +- web/src/views/Queues.tsx | 27 +- web/src/views/Search.tsx | 109 +- web/src/views/Series.tsx | 74 +- web/src/views/Settings.tsx | 438 ++++--- web/src/views/TvDeck.tsx | 62 +- 19 files changed, 1607 insertions(+), 2925 deletions(-) create mode 100644 web/src/look.ts diff --git a/web/scripts/check-tokens.mjs b/web/scripts/check-tokens.mjs index 2c21db2..1ebd785 100644 --- a/web/scripts/check-tokens.mjs +++ b/web/scripts/check-tokens.mjs @@ -40,7 +40,8 @@ function walk(dir, out = []) { } const COLOR_LITERAL = /#[0-9a-fA-F]{3,8}\b|\b(?:oklch|oklab|lab|lch|rgba?|hsla?|hwb|color)\(/; -const RELATIVE_FROM_TOKEN = /\b(?:oklch|oklab|lab|lch|rgb|hsl|hwb|color)\(\s*from\s+var\(--/g; +// `_` is a space inside a Tailwind arbitrary value +const RELATIVE_FROM_TOKEN = /\b(?:oklch|oklab|lab|lch|rgb|hsl|hwb|color)\([\s_]*from[\s_]+var\(--/g; const SPACING_PROP = /^(?:margin|padding|gap|row-gap|column-gap|inset)(?:-[a-z-]+)?$/; const SPACING_VALUE = /^(?:var\(--[\w-]+\)|0|auto|-?[\d.]+%)$/; const FONT_SIZE_VALUE = /^var\(--text-[\w-]+\)$/; @@ -108,7 +109,8 @@ function checkCss(source, rel) { } } -const ARBITRARY = /(?:^|[\s"'`:])!?-?[a-z][\w-]*-\[([^\]\s]+)\]/g; +// a value, not a variant: `data-[tone=fault]:` selects, it does not style +const ARBITRARY = /(?:^|[\s"'`:])!?-?[a-z][\w-]*-\[([^\]\s]+)\](?!:)/g; function checkPlain(source, rel) { // Comments are prose, not styling — `checkCss` already ignores them, and diff --git a/web/src/App.tsx b/web/src/App.tsx index c2efe0f..59c798b 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -16,6 +16,7 @@ import { LAYER, LiveContext, type Nav, NavContext, type TvDeckRequest, useEscape import { type Download, fetchDownloads } from "./downloads"; import { type Probe, probeHealth } from "./health"; import { Icon, type IconName } from "./icons"; +import { control, cx } from "./look"; import { two } from "./parts"; import { currentRoute, @@ -158,6 +159,14 @@ function restoreFocus(target: HTMLElement | null) { }); } +/** A rail destination: engraved mono words, an accent rule under the current one. */ +const NAV_LINK = + "inline-flex items-center gap-2 min-h-control-h py-0 px-3 font-readout text-xs font-semibold uppercase tracking-label text-ink-muted no-underline border-b-2 border-b-transparent hover:text-accent-bright aria-[current=page]:text-accent aria-[current=page]:border-b-accent"; + +/** A tab bar destination: glyph over word, a short accent rule on top of the current one. */ +const TAB = + "relative grid place-items-center content-center gap-1 text-2xs font-semibold uppercase tracking-wide text-ink-faint no-underline aria-[current=page]:text-accent aria-[current=page]:before:absolute aria-[current=page]:before:top-0 aria-[current=page]:before:inset-x-3/10 aria-[current=page]:before:h-rule aria-[current=page]:before:bg-accent"; + function TabGlyph({ name }: { name: IconName }) { return (