shadcn uses `bg-accent` for its SUBTLE surfaces — dropdown item hover, command row selection, ghost and outline button hover, the dialog close affordance. The brand colour in shadcn is `primary`. PIG's Tailwind config mapped `accent` to `--accent`, which is the brand. That inverted the meaning, so every shadcn hover and selection state painted a full-strength brand block. With the monochrome "pig" palette in dark mode the brand is near-white, so a selected command row rendered as a white slab against a near-black sheet. Measured before the change: selected row rgb(250,250,250) on a rgb(9,9,11) body. `accent` now aliases `--accent-subtle` and `accent-foreground` aliases `--accent-fg`, which is what those tokens were created for. The eleven places where PIG's own components wanted a solid brand fill — filled chips, selected card borders, progress bars — move to `primary`, which still resolves to `--accent`. A `brand` alias is added for clarity. After: selected row rgb(39,39,42) in dark and rgb(244,244,245) in light, both a subtle tint above the body; the pipeline's active stage chip stays a solid rgb(250,250,250) fill, unchanged. Found by opening overlays, which earlier screenshot sweeps never did — every route had been checked, but a dropdown or a command palette only misbehaves once it is open. Worth remembering: page-level sweeps do not exercise portals. Typecheck clean, 135 unit tests and e2e green, CSP hash unchanged, 0px horizontal overflow across 12 routes at 393px and 1440px. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -140,6 +140,14 @@ conflict on, do an existence check instead.
|
|||||||
flag set to false was silently on. Use the `envBoolean` helper in
|
flag set to false was silently on. Use the `envBoolean` helper in
|
||||||
`apps/api/src/lib/config.ts`.
|
`apps/api/src/lib/config.ts`.
|
||||||
|
|
||||||
|
**shadcn's `accent` is a SUBTLE surface, not the brand.** shadcn uses
|
||||||
|
`bg-accent` for hover, focus and selected states — dropdown items, command
|
||||||
|
rows, ghost buttons. The brand is `primary`. In `tailwind.config.js`, `accent`
|
||||||
|
is therefore aliased to `--accent-subtle` and `primary` to `--accent`. Use
|
||||||
|
`bg-primary` for a solid brand fill; never `bg-accent`. Mapping them the other
|
||||||
|
way makes every hover state paint a full-strength brand block, which in dark
|
||||||
|
mode with the monochrome palette is a glaring white slab.
|
||||||
|
|
||||||
**Grid and flex children need `min-w-0`.** They default to
|
**Grid and flex children need `min-w-0`.** They default to
|
||||||
`min-width: auto`, meaning they refuse to shrink below their content — and a
|
`min-width: auto`, meaning they refuse to shrink below their content — and a
|
||||||
`tabular-nums` figure, a `whitespace-nowrap` badge or a `truncate` title is all
|
`tabular-nums` figure, a `whitespace-nowrap` badge or a `truncate` title is all
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ export function AdminSettings() {
|
|||||||
<div className="relative overflow-hidden border-b border-border bg-surface-2 px-4 py-5 sm:px-6">
|
<div className="relative overflow-hidden border-b border-border bg-surface-2 px-4 py-5 sm:px-6">
|
||||||
<div className="absolute -right-12 -top-20 size-48 rounded-full bg-accent-subtle blur-3xl" aria-hidden />
|
<div className="absolute -right-12 -top-20 size-48 rounded-full bg-accent-subtle blur-3xl" aria-hidden />
|
||||||
<div className="relative flex items-start gap-3">
|
<div className="relative flex items-start gap-3">
|
||||||
<div className="flex size-10 shrink-0 items-center justify-center rounded-xl bg-accent text-accent-on">
|
<div className="flex size-10 shrink-0 items-center justify-center rounded-xl bg-primary text-accent-on">
|
||||||
<ShieldCheck aria-hidden />
|
<ShieldCheck aria-hidden />
|
||||||
</div>
|
</div>
|
||||||
<div className="min-w-0">
|
<div className="min-w-0">
|
||||||
|
|||||||
@@ -526,8 +526,8 @@ function CommitmentContext({ row, detail, match, quotedPrice }: { row: Availabil
|
|||||||
{match ? <Badge tone={match.score > 0.7 ? 'positive' : 'neutral'}>{percent(match.score)} fit</Badge> : null}
|
{match ? <Badge tone={match.score > 0.7 ? 'positive' : 'neutral'}>{percent(match.score)} fit</Badge> : null}
|
||||||
</div>
|
</div>
|
||||||
<div className="mt-4 flex h-2 overflow-hidden rounded-full bg-surface">
|
<div className="mt-4 flex h-2 overflow-hidden rounded-full bg-surface">
|
||||||
<div className="bg-accent" style={{ width: `${Math.min(100, soldPct * 100)}%` }} />
|
<div className="bg-primary" style={{ width: `${Math.min(100, soldPct * 100)}%` }} />
|
||||||
<div className="bg-accent/35" style={{ width: `${Math.min(100 - soldPct * 100, heldPct * 100)}%` }} />
|
<div className="bg-primary/35" style={{ width: `${Math.min(100 - soldPct * 100, heldPct * 100)}%` }} />
|
||||||
</div>
|
</div>
|
||||||
<div className="mt-2 grid grid-cols-3 gap-2 text-xs">
|
<div className="mt-2 grid grid-cols-3 gap-2 text-xs">
|
||||||
<div><p className="text-muted">Sold</p><p className="nums mt-0.5 font-medium">{compactNumber(row.soldGpuHours)} hrs</p></div>
|
<div><p className="text-muted">Sold</p><p className="nums mt-0.5 font-medium">{compactNumber(row.soldGpuHours)} hrs</p></div>
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ export function GoogleSheetsSource({ onLoaded }: { onLoaded(table: GoogleParsedT
|
|||||||
{files.isLoading ? <Skeleton className="h-40" /> : files.isError ? <ErrorText error={files.error} /> : files.data?.files.length === 0 ? <EmptyState title="No spreadsheets found" description="Try another name or confirm this Google account can see the spreadsheet." /> : (
|
{files.isLoading ? <Skeleton className="h-40" /> : files.isError ? <ErrorText error={files.error} /> : files.data?.files.length === 0 ? <EmptyState title="No spreadsheets found" description="Try another name or confirm this Google account can see the spreadsheet." /> : (
|
||||||
<div className="grid gap-2 sm:grid-cols-2">
|
<div className="grid gap-2 sm:grid-cols-2">
|
||||||
{files.data?.files.map((file) => (
|
{files.data?.files.map((file) => (
|
||||||
<button key={file.id} type="button" onClick={() => { setSpreadsheetId(file.id); setSheetId(''); }} className={spreadsheetId === file.id ? 'tap min-w-0 rounded-lg border border-accent bg-accent-subtle p-3 text-left' : 'tap min-w-0 rounded-lg border border-border p-3 text-left hover:bg-surface-2'}>
|
<button key={file.id} type="button" onClick={() => { setSpreadsheetId(file.id); setSheetId(''); }} className={spreadsheetId === file.id ? 'tap min-w-0 rounded-lg border border-primary bg-accent-subtle p-3 text-left' : 'tap min-w-0 rounded-lg border border-border p-3 text-left hover:bg-surface-2'}>
|
||||||
<p className="truncate text-sm font-medium">{file.name}</p>
|
<p className="truncate text-sm font-medium">{file.name}</p>
|
||||||
<p className="mt-1 text-xs text-muted">{file.modifiedTime ? `Modified ${relativeTime(file.modifiedTime)}` : 'Modified time unavailable'}</p>
|
<p className="mt-1 text-xs text-muted">{file.modifiedTime ? `Modified ${relativeTime(file.modifiedTime)}` : 'Modified time unavailable'}</p>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -264,7 +264,7 @@ function PiggyChatPanel({
|
|||||||
|
|
||||||
function ChatMessage({ message }: { message: TranscriptMessage }) {
|
function ChatMessage({ message }: { message: TranscriptMessage }) {
|
||||||
if (message.role === 'user') {
|
if (message.role === 'user') {
|
||||||
return <div className="ml-auto max-w-[88%] rounded-2xl rounded-br-md bg-accent px-4 py-3 text-sm text-accent-on"><p className="whitespace-pre-wrap">{message.content}</p></div>;
|
return <div className="ml-auto max-w-[88%] rounded-2xl rounded-br-md bg-primary px-4 py-3 text-sm text-accent-on"><p className="whitespace-pre-wrap">{message.content}</p></div>;
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<div className="flex gap-3">
|
<div className="flex gap-3">
|
||||||
|
|||||||
@@ -161,9 +161,9 @@ function CapacityCard({ row, writable, onAllocate }: { row: AvailabilityRow; wri
|
|||||||
bar made mostly of unconverted holds is a lie a seller would act on. */}
|
bar made mostly of unconverted holds is a lie a seller would act on. */}
|
||||||
<div>
|
<div>
|
||||||
<div className="flex h-2 overflow-hidden rounded-full bg-surface-2">
|
<div className="flex h-2 overflow-hidden rounded-full bg-surface-2">
|
||||||
<div className="bg-accent" style={{ width: `${Math.min(100, soldPct * 100)}%` }} />
|
<div className="bg-primary" style={{ width: `${Math.min(100, soldPct * 100)}%` }} />
|
||||||
<div
|
<div
|
||||||
className="bg-accent/35"
|
className="bg-primary/35"
|
||||||
style={{ width: `${Math.min(100 - soldPct * 100, heldPct * 100)}%` }}
|
style={{ width: `${Math.min(100 - soldPct * 100, heldPct * 100)}%` }}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ export function CreateProfile({
|
|||||||
className={[
|
className={[
|
||||||
'flex cursor-pointer items-start gap-3 rounded-lg border p-3 transition-colors',
|
'flex cursor-pointer items-start gap-3 rounded-lg border p-3 transition-colors',
|
||||||
team === value
|
team === value
|
||||||
? 'border-accent bg-accent-subtle'
|
? 'border-primary bg-accent-subtle'
|
||||||
: 'border-border hover:bg-surface-2',
|
: 'border-border hover:bg-surface-2',
|
||||||
].join(' ')}
|
].join(' ')}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ export function FactReview() {
|
|||||||
</Badge>
|
</Badge>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<Card className="overflow-hidden border-accent/30 bg-accent-subtle/40">
|
<Card className="overflow-hidden border-primary/30 bg-accent-subtle/40">
|
||||||
<CardContent className="flex gap-3 p-4 sm:p-5">
|
<CardContent className="flex gap-3 p-4 sm:p-5">
|
||||||
<FileCheck2 className="mt-0.5 size-5 shrink-0 text-accent-fg" aria-hidden />
|
<FileCheck2 className="mt-0.5 size-5 shrink-0 text-accent-fg" aria-hidden />
|
||||||
<div className="min-w-0">
|
<div className="min-w-0">
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ export function Imports() {
|
|||||||
type="button"
|
type="button"
|
||||||
aria-pressed={entity === candidate}
|
aria-pressed={entity === candidate}
|
||||||
onClick={() => resetForEntity(candidate)}
|
onClick={() => resetForEntity(candidate)}
|
||||||
className={entity === candidate ? 'tap card min-w-0 border-accent p-4 text-left ring-1 ring-accent' : 'tap card min-w-0 p-4 text-left'}
|
className={entity === candidate ? 'tap card min-w-0 border-primary p-4 text-left ring-1 ring-primary' : 'tap card min-w-0 p-4 text-left'}
|
||||||
>
|
>
|
||||||
<p className="font-semibold">{candidateDefinition.label}</p>
|
<p className="font-semibold">{candidateDefinition.label}</p>
|
||||||
<p className="mt-1 text-xs leading-relaxed text-muted">{candidateDefinition.description}</p>
|
<p className="mt-1 text-xs leading-relaxed text-muted">{candidateDefinition.description}</p>
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ function PipelineBoard<T extends { id: string; stage: string; updatedAt: string
|
|||||||
className={[
|
className={[
|
||||||
'tap shrink-0 rounded-full px-3.5 text-sm font-medium transition-colors',
|
'tap shrink-0 rounded-full px-3.5 text-sm font-medium transition-colors',
|
||||||
stage === currentStage
|
stage === currentStage
|
||||||
? 'bg-accent text-accent-on'
|
? 'bg-primary text-accent-on'
|
||||||
: 'bg-surface-2 text-muted',
|
: 'bg-surface-2 text-muted',
|
||||||
].join(' ')}
|
].join(' ')}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ export function Register({
|
|||||||
className={[
|
className={[
|
||||||
'flex cursor-pointer items-start gap-3 rounded-lg border p-3 transition-colors',
|
'flex cursor-pointer items-start gap-3 rounded-lg border p-3 transition-colors',
|
||||||
team === value
|
team === value
|
||||||
? 'border-accent bg-accent-subtle'
|
? 'border-primary bg-accent-subtle'
|
||||||
: 'border-border hover:bg-surface-2',
|
: 'border-border hover:bg-surface-2',
|
||||||
].join(' ')}
|
].join(' ')}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ function Appearance() {
|
|||||||
title={option.label}
|
title={option.label}
|
||||||
className={[
|
className={[
|
||||||
'tap relative flex items-center gap-2 rounded-lg border px-3 py-2 text-sm font-medium transition-colors',
|
'tap relative flex items-center gap-2 rounded-lg border px-3 py-2 text-sm font-medium transition-colors',
|
||||||
selected ? 'border-accent bg-accent-subtle' : 'border-border hover:bg-surface-2',
|
selected ? 'border-primary bg-accent-subtle' : 'border-border hover:bg-surface-2',
|
||||||
].join(' ')}
|
].join(' ')}
|
||||||
>
|
>
|
||||||
{/*
|
{/*
|
||||||
|
|||||||
@@ -20,8 +20,22 @@ export default {
|
|||||||
foreground: 'hsl(var(--fg))',
|
foreground: 'hsl(var(--fg))',
|
||||||
muted: 'hsl(var(--muted))',
|
muted: 'hsl(var(--muted))',
|
||||||
'muted-foreground': 'hsl(var(--muted))',
|
'muted-foreground': 'hsl(var(--muted))',
|
||||||
accent: 'hsl(var(--accent))',
|
/*
|
||||||
'accent-foreground': 'hsl(var(--accent-on))',
|
* shadcn's `accent` is its SUBTLE hover/selected surface — dropdown
|
||||||
|
* items, command rows, ghost-button hover. It is not the brand colour;
|
||||||
|
* that is `primary`, mapped below.
|
||||||
|
*
|
||||||
|
* Mapping `accent` to --accent (the brand) inverted this, so every
|
||||||
|
* hover state painted a full-strength brand block: in dark mode with
|
||||||
|
* the monochrome "pig" accent that is near-white, which made a selected
|
||||||
|
* command row glare. Aliased to the subtle pair instead, so shadcn
|
||||||
|
* primitives tint the way their authors intended while PIG's own brand
|
||||||
|
* fills use `primary`.
|
||||||
|
*/
|
||||||
|
accent: 'hsl(var(--accent-subtle))',
|
||||||
|
'accent-foreground': 'hsl(var(--accent-fg))',
|
||||||
|
/** The brand itself, for PIG's own components that need a solid fill. */
|
||||||
|
brand: 'hsl(var(--accent))',
|
||||||
'accent-fg': 'hsl(var(--accent-fg))',
|
'accent-fg': 'hsl(var(--accent-fg))',
|
||||||
'accent-on': 'hsl(var(--accent-on))',
|
'accent-on': 'hsl(var(--accent-on))',
|
||||||
'accent-subtle': 'hsl(var(--accent-subtle))',
|
'accent-subtle': 'hsl(var(--accent-subtle))',
|
||||||
|
|||||||
Reference in New Issue
Block a user