refactor: replace hardcoded hex values with Tailwind semantic tokens
3,200+ hardcoded color values replaced with CSS variable-backed Tailwind classes (bg-card, text-foreground, border-border, etc.). Enables light mode via CSS variable swap. Only syntax highlighting colors and intentional one-offs remain hardcoded (~15 values). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -84,14 +84,14 @@ export function UploadScreen({ quota, onSubmitText, onSubmitFile, loading }: Upl
|
||||
{quota && (
|
||||
<div className="card-flat p-4 flex items-center justify-between">
|
||||
<div className="flex items-center gap-3">
|
||||
<Sparkles size={18} className="text-[#22d3ee]" />
|
||||
<Sparkles size={18} className="text-primary" />
|
||||
<div>
|
||||
<p className="text-sm font-medium text-[#e2e5eb]">
|
||||
<p className="text-sm font-medium text-foreground">
|
||||
{quota.lifetime_conversions_limit
|
||||
? `${quota.lifetime_conversions_limit - quota.lifetime_conversions_used} conversions remaining`
|
||||
: 'Unlimited conversions'}
|
||||
</p>
|
||||
<p className="text-xs text-[#848b9b]">
|
||||
<p className="text-xs text-muted-foreground">
|
||||
{quota.plan.charAt(0).toUpperCase() + quota.plan.slice(1)} plan
|
||||
</p>
|
||||
</div>
|
||||
@@ -112,8 +112,8 @@ export function UploadScreen({ quota, onSubmitText, onSubmitFile, loading }: Upl
|
||||
className={cn(
|
||||
'flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors',
|
||||
mode === 'paste'
|
||||
? 'bg-[rgba(34,211,238,0.10)] text-[#e2e5eb] border border-primary/30'
|
||||
: 'bg-[rgba(255,255,255,0.04)] border border-[rgba(255,255,255,0.06)] text-[#848b9b] hover:text-[#e2e5eb] hover:border-[rgba(255,255,255,0.12)]'
|
||||
? 'bg-accent-dim text-foreground border border-primary/30'
|
||||
: 'bg-[rgba(255,255,255,0.04)] border border-[rgba(255,255,255,0.06)] text-muted-foreground hover:text-foreground hover:border-[rgba(255,255,255,0.12)]'
|
||||
)}
|
||||
>
|
||||
<ClipboardPaste size={16} />
|
||||
@@ -125,8 +125,8 @@ export function UploadScreen({ quota, onSubmitText, onSubmitFile, loading }: Upl
|
||||
className={cn(
|
||||
'flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors',
|
||||
mode === 'file'
|
||||
? 'bg-[rgba(34,211,238,0.10)] text-[#e2e5eb] border border-primary/30'
|
||||
: 'bg-[rgba(255,255,255,0.04)] border border-[rgba(255,255,255,0.06)] text-[#848b9b] hover:text-[#e2e5eb] hover:border-[rgba(255,255,255,0.12)]'
|
||||
? 'bg-accent-dim text-foreground border border-primary/30'
|
||||
: 'bg-[rgba(255,255,255,0.04)] border border-[rgba(255,255,255,0.06)] text-muted-foreground hover:text-foreground hover:border-[rgba(255,255,255,0.12)]'
|
||||
)}
|
||||
>
|
||||
<FileUp size={16} />
|
||||
@@ -140,7 +140,7 @@ export function UploadScreen({ quota, onSubmitText, onSubmitFile, loading }: Upl
|
||||
{mode === 'paste' ? (
|
||||
<>
|
||||
<div>
|
||||
<label htmlFor="kb-title" className="block font-sans text-xs text-[0.625rem] uppercase tracking-[0.1em] text-[#848b9b] mb-1.5">
|
||||
<label htmlFor="kb-title" className="block font-sans text-xs text-[0.625rem] uppercase tracking-[0.1em] text-muted-foreground mb-1.5">
|
||||
Title (optional)
|
||||
</label>
|
||||
<Input
|
||||
@@ -152,7 +152,7 @@ export function UploadScreen({ quota, onSubmitText, onSubmitFile, loading }: Upl
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<label htmlFor="kb-content" className="block font-sans text-xs text-[0.625rem] uppercase tracking-[0.1em] text-[#848b9b] mb-1.5">
|
||||
<label htmlFor="kb-content" className="block font-sans text-xs text-[0.625rem] uppercase tracking-[0.1em] text-muted-foreground mb-1.5">
|
||||
KB Article Content
|
||||
</label>
|
||||
<Textarea
|
||||
@@ -163,7 +163,7 @@ export function UploadScreen({ quota, onSubmitText, onSubmitFile, loading }: Upl
|
||||
rows={12}
|
||||
maxLength={500000}
|
||||
/>
|
||||
<p className="mt-1 text-xs text-[#848b9b]">
|
||||
<p className="mt-1 text-xs text-muted-foreground">
|
||||
{content.length.toLocaleString()} / 500,000 characters
|
||||
</p>
|
||||
</div>
|
||||
@@ -183,15 +183,15 @@ export function UploadScreen({ quota, onSubmitText, onSubmitFile, loading }: Upl
|
||||
>
|
||||
{file ? (
|
||||
<>
|
||||
<FileText size={32} className="text-[#22d3ee]" />
|
||||
<FileText size={32} className="text-primary" />
|
||||
<div className="text-center">
|
||||
<p className="text-sm font-medium text-[#e2e5eb]">{file.name}</p>
|
||||
<p className="text-xs text-[#848b9b] mt-1">
|
||||
<p className="text-sm font-medium text-foreground">{file.name}</p>
|
||||
<p className="text-xs text-muted-foreground mt-1">
|
||||
{(file.size / 1024).toFixed(1)} KB
|
||||
</p>
|
||||
<button
|
||||
onClick={e => { e.stopPropagation(); setFile(null) }}
|
||||
className="mt-2 text-xs text-[#22d3ee] hover:underline"
|
||||
className="mt-2 text-xs text-primary hover:underline"
|
||||
>
|
||||
Remove
|
||||
</button>
|
||||
@@ -199,12 +199,12 @@ export function UploadScreen({ quota, onSubmitText, onSubmitFile, loading }: Upl
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<Upload size={32} className="text-[#848b9b]" />
|
||||
<Upload size={32} className="text-muted-foreground" />
|
||||
<div className="text-center">
|
||||
<p className="text-sm text-[#e2e5eb]">
|
||||
Drop a file here or <span className="text-[#22d3ee]">browse</span>
|
||||
<p className="text-sm text-foreground">
|
||||
Drop a file here or <span className="text-primary">browse</span>
|
||||
</p>
|
||||
<p className="text-xs text-[#848b9b] mt-1">
|
||||
<p className="text-xs text-muted-foreground mt-1">
|
||||
Supported: {fileFormats.map(f => FORMAT_LABELS[f] || f.toUpperCase()).join(', ')}
|
||||
</p>
|
||||
</div>
|
||||
@@ -223,7 +223,7 @@ export function UploadScreen({ quota, onSubmitText, onSubmitFile, loading }: Upl
|
||||
|
||||
{/* Target type selector */}
|
||||
<div>
|
||||
<p className="font-sans text-xs text-[0.625rem] uppercase tracking-[0.1em] text-[#848b9b] mb-2">
|
||||
<p className="font-sans text-xs text-[0.625rem] uppercase tracking-[0.1em] text-muted-foreground mb-2">
|
||||
Target Flow Type
|
||||
</p>
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 gap-3">
|
||||
@@ -238,8 +238,8 @@ export function UploadScreen({ quota, onSubmitText, onSubmitFile, loading }: Upl
|
||||
: 'hover:border-[rgba(255,255,255,0.12)]'
|
||||
)}
|
||||
>
|
||||
<p className="text-sm font-medium text-[#e2e5eb]">{t.label}</p>
|
||||
<p className="text-xs text-[#848b9b] mt-1">{t.description}</p>
|
||||
<p className="text-sm font-medium text-foreground">{t.label}</p>
|
||||
<p className="text-xs text-muted-foreground mt-1">{t.description}</p>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
@@ -251,7 +251,7 @@ export function UploadScreen({ quota, onSubmitText, onSubmitFile, loading }: Upl
|
||||
disabled={!canSubmit || loading || (quota != null && !quota.can_convert)}
|
||||
className={cn(
|
||||
'w-full flex items-center justify-center gap-2 px-6 py-3 rounded-lg text-sm font-semibold transition-all',
|
||||
'bg-[#22d3ee] text-white',
|
||||
'bg-primary text-white',
|
||||
'hover:brightness-110 active:scale-[0.98]',
|
||||
'disabled:opacity-50 disabled:cursor-not-allowed'
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user