refactor(web): move the stylesheet into Tailwind utilities (#281)
ci / web (push) Successful in 33s
e2e / e2e (push) Successful in 1m36s
ci / rust (push) Successful in 1m49s
ci / image (push) Successful in 2m36s

This commit was merged in pull request #281.
This commit is contained in:
2026-11-11 21:14:23 +00:00
parent 5528ac8aa8
commit 5a18facc4f
19 changed files with 1607 additions and 2925 deletions
+18 -10
View File
@@ -6,6 +6,12 @@ import { useLive } from "./context";
import { downloadChipDetail, downloadChipLabel, findDownload } from "./downloads";
import { Icon, Star } from "./icons";
import { waiverLabel } from "./library";
import { CHIP_ICON } from "./look";
/** A row's lead thumbnail at 2:3; a missing one keeps the same box. */
const POSTER =
"block w-poster aspect-2/3 flex-none object-cover bg-panel-raised border border-line rounded-chip";
import { formatRating, formatVoteCount, tmdbImage } from "./movie";
import { Chip, type Say } from "./ui";
@@ -38,7 +44,9 @@ export function TitleText({ title, year }: { title: string; year: number | null
return (
<span>
{title}
{year !== null && <span className="yr">{year}</span>}
{year !== null && (
<span className="ml-2 font-readout text-xs font-normal text-ink-faint">{year}</span>
)}
</span>
);
}
@@ -54,7 +62,7 @@ export function MediaStateChip({ state, wanted }: { state: string; wanted: boole
// makes the word reachable once the glyph replaced it
return (
<Chip role="img" aria-label={state} data-movie-state={state} data-wanted={String(wanted)}>
<Icon name="check" />
<Icon name="check" className={CHIP_ICON} />
</Chip>
);
}
@@ -78,13 +86,13 @@ export function WaiverChip({ waiver, say }: { waiver: unknown; say?: Say }) {
}
return (
<Chip
base="chip chip-glyph"
glyph
data-verdict="waived"
aria-label={label}
role={say ? undefined : "img"}
explain={say ? { text: `imported below policy — ${label}`, say, tone: "warn" } : undefined}
>
<Icon name="warning" />
<Icon name="warning" className={CHIP_ICON} />
</Chip>
);
}
@@ -109,10 +117,10 @@ export function DownloadChip({
const { downloads } = useLive();
const download = findDownload(downloads, targetKind, targetId);
return (
<span className="dl-slot" data-dl-kind={targetKind} data-dl-id={targetId}>
<span className="contents" data-dl-kind={targetKind} data-dl-id={targetId}>
{download !== null && (
<Chip
className="dl-chip"
download
data-dl-phase={download.phase}
aria-label={`download ${downloadChipDetail(download)}`}
explain={say ? { text: `download ${downloadChipDetail(download)}`, say } : undefined}
@@ -148,7 +156,7 @@ export function CountsChip({
}) {
return (
<Chip data-counts={countsTone(available, total)} aria-label={ariaLabel}>
{glyph && <Icon name="disk" />}
{glyph && <Icon name="disk" className={CHIP_ICON} />}
{label}
</Chip>
);
@@ -200,11 +208,11 @@ export function RatingChip({
export function RowPoster({ posterPath, title }: { posterPath: string | null; title: string }) {
const [broken, setBroken] = useState(false);
if (posterPath === null || broken) {
return <span className="row-poster-blank" aria-hidden="true" />;
return <span className={POSTER} aria-hidden="true" />;
}
return (
<img
className="row-poster"
className={POSTER}
loading="lazy"
src={tmdbImage(posterPath, "w92") ?? ""}
alt={`${title} poster`}
@@ -217,7 +225,7 @@ export function RowPoster({ posterPath, title }: { posterPath: string | null; ti
/** The amber lamp that leads every attention-queue row. */
export function AttentionLamp() {
return (
<span className="lead-lamp">
<span className="flex w-4 justify-center">
<span className="lamp" data-state="warn" aria-hidden="true" />
</span>
);