refactor(theme): tokenise hard-coded amber shadows and reconcile duplicate @font-face declarations

Hard-coded rgba(214,132,80,X) shadows were tied to the dark-theme accent
and stayed off-hue in light mode (where the accent is a darker #a3683a).
Six tokens added to app.css @theme and mirrored in the light-theme block
plus design-system/colors_and_type.css:

  --shadow-accent-sm     0 0 8px   0.25 alpha  Toggle on-state
  --shadow-accent-md     0 4px 16px 0.3       ModelDownloader card
  --shadow-accent-lg     0 4px 20px 0.3       DictationPage record button
  --shadow-accent-glow   0 0 8px   0.4        progress-bar glow
  --shadow-accent-pill   0 1px 4px 0.3        SegmentedButton pill
  --shadow-accent-raised 0 2px 8px 0.2        FilesPage browse tile

Migrated seven sites: Toggle, SegmentedButton, ModelDownloader (x2),
FilesPage (x2), DictationPage record button, SettingsPage locale pill.
Focus-ring shadows (0_0_0_3px_rgba(...,0.1)) left alone — handled in
parallel via the --accent-shadow-focus token.

@font-face: app.css and colors_and_type.css both declare the same five
fonts. Duplication is unavoidable because preview/*.html loads the
design-system file directly without Vite, so it cannot share the
runtime declarations. font-weight ranges and font-style reconciled to
match exactly (Atkinson 200-800 not 400-700, JetBrains gains font-style:
normal); src URLs intentionally differ (root-absolute vs relative).
Comments added to both copies explaining the contract.
This commit is contained in:
2026-05-07 11:31:14 +01:00
parent f4c0635549
commit aecb191705
8 changed files with 80 additions and 12 deletions

View File

@@ -82,7 +82,7 @@
<div class="mb-4">
<div class="h-[6px] bg-bg-elevated rounded-full overflow-hidden mb-2">
<div
class="h-full bg-accent rounded-full transition-all duration-300 shadow-[0_0_8px_rgba(214,132,80,0.4)]"
class="h-full bg-accent rounded-full transition-all duration-300 shadow-[var(--shadow-accent-glow)]"
style="width: {progress}%"
></div>
</div>
@@ -93,7 +93,7 @@
{:else}
<button
class="px-6 py-2.5 rounded-xl text-[14px] font-medium text-white bg-accent hover:bg-accent-hover
shadow-[0_4px_16px_rgba(214,132,80,0.3)] transition-all duration-150"
shadow-[var(--shadow-accent-md)] transition-all duration-150"
onclick={startDownload}
>
Download Model

View File

@@ -8,7 +8,7 @@
class="rounded-lg font-medium
{size === 'small' ? 'px-2.5 py-1 text-[12px]' : 'px-3.5 py-[6px] text-[12px]'}
{value === option
? 'bg-accent text-bg shadow-[0_1px_4px_rgba(214,132,80,0.3)]'
? 'bg-accent text-bg shadow-[var(--shadow-accent-pill)]'
: 'text-text-secondary hover:text-text hover:bg-hover'}"
style="transition-duration: var(--duration-ui)"
onclick={() => value = option}

View File

@@ -59,7 +59,7 @@
<div class="flex items-start gap-3 py-2.5">
<button
class="relative mt-0.5 w-[38px] min-w-[38px] h-[22px] rounded-full flex-shrink-0
{checked ? 'bg-accent shadow-[0_0_8px_rgba(214,132,80,0.25)]' : 'bg-bg-elevated'}
{checked ? 'bg-accent shadow-[var(--shadow-accent-sm)]' : 'bg-bg-elevated'}
{disabled && !busy ? 'opacity-50 cursor-not-allowed' : ''}
{busy ? 'cursor-wait' : ''}"
onclick={handleClick}