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 (