From a7fbd29a6761c0d3178768f31b89f6acfcded694 Mon Sep 17 00:00:00 2001 From: Till JS Date: Thu, 9 Apr 2026 12:37:29 +0200 Subject: [PATCH] style(mana/web): migrate photos/times/contacts module helpers to theme tokens (P5) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit photos/PhotoCard + PhotoDetailModal: bare var() refs → hsl(var()), broken fallbacks dropped. The lightbox backdrop stays explicit near-black — photo viewing chrome is intentionally theme-neutral. times/FocusCard: phase color (focus=red, break=green, idle=muted) reads theme tokens via wrapped hsl() strings so the SVG ring tracks variants. The bogus --color-input fallback is gone. times/EntryItem: was referencing the long-removed shadcn aliases without the --color- prefix (--border, --card, --foreground, --muted-foreground, --primary, --input). Re-prefixed; --input → --background since we have no separate input token. The delete button's text-red-500 / hover bg are now --color-error so they track theme variants. contacts/ContactPage: avatar + self-badge color-mix fallback chains collapse to plain hsl(var(--color-primary) / 0.12). The cycles pink #ec4899 birthday accent on the contact row stays literal — it's a deliberate brand color, not theme intent. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../components/pages/ContactPage.svelte | 12 ++++---- .../components/gallery/PhotoCard.svelte | 22 ++++++-------- .../gallery/PhotoDetailModal.svelte | 30 ++++++++++--------- .../modules/times/components/EntryItem.svelte | 30 +++++++++---------- .../modules/times/components/FocusCard.svelte | 17 +++++++---- 5 files changed, 58 insertions(+), 53 deletions(-) diff --git a/apps/mana/apps/web/src/lib/modules/contacts/components/pages/ContactPage.svelte b/apps/mana/apps/web/src/lib/modules/contacts/components/pages/ContactPage.svelte index 21fa4d7a2..df60c7046 100644 --- a/apps/mana/apps/web/src/lib/modules/contacts/components/pages/ContactPage.svelte +++ b/apps/mana/apps/web/src/lib/modules/contacts/components/pages/ContactPage.svelte @@ -422,8 +422,8 @@ width: 2rem; height: 2rem; border-radius: 9999px; - background: color-mix(in srgb, var(--color-primary, #8b5cf6) 12%, transparent); - color: var(--color-primary, #8b5cf6); + background: hsl(var(--color-primary) / 0.12); + color: hsl(var(--color-primary)); display: flex; align-items: center; justify-content: center; @@ -499,8 +499,8 @@ font-weight: 600; padding: 0.0625rem 0.375rem; border-radius: 9999px; - background: color-mix(in srgb, var(--color-primary, #8b5cf6) 12%, transparent); - color: var(--color-primary, #8b5cf6); + background: hsl(var(--color-primary) / 0.12); + color: hsl(var(--color-primary)); flex-shrink: 0; } @@ -521,8 +521,8 @@ width: 4.5rem; height: 4.5rem; border-radius: 9999px; - background: color-mix(in srgb, var(--color-primary, #8b5cf6) 12%, transparent); - color: var(--color-primary, #8b5cf6); + background: hsl(var(--color-primary) / 0.12); + color: hsl(var(--color-primary)); display: flex; align-items: center; justify-content: center; diff --git a/apps/mana/apps/web/src/lib/modules/photos/components/gallery/PhotoCard.svelte b/apps/mana/apps/web/src/lib/modules/photos/components/gallery/PhotoCard.svelte index ae485a441..be2dee687 100644 --- a/apps/mana/apps/web/src/lib/modules/photos/components/gallery/PhotoCard.svelte +++ b/apps/mana/apps/web/src/lib/modules/photos/components/gallery/PhotoCard.svelte @@ -64,8 +64,8 @@ position: relative; aspect-ratio: 1; overflow: hidden; - border-radius: var(--radius-md, 0.5rem); - background-color: var(--color-muted, #f1f5f9); + border-radius: 0.5rem; + background-color: hsl(var(--color-muted)); cursor: pointer; border: none; padding: 0; @@ -76,18 +76,14 @@ .photo-card:hover { transform: scale(1.02); - box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2); + box-shadow: 0 10px 20px hsl(0 0% 0% / 0.2); z-index: 10; } .placeholder { position: absolute; inset: 0; - background: linear-gradient( - 135deg, - var(--color-muted, #f1f5f9) 0%, - var(--color-accent, #e2e8f0) 100% - ); + background: linear-gradient(135deg, hsl(var(--color-muted)) 0%, hsl(var(--color-accent)) 100%); animation: pulse 2s ease-in-out infinite; } @@ -119,13 +115,13 @@ display: flex; align-items: center; justify-content: center; - color: var(--color-muted-foreground, #64748b); + color: hsl(var(--color-muted-foreground)); } .photo-overlay { position: absolute; inset: 0; - background: linear-gradient(to top, rgba(0, 0, 0, 0.5) 0%, transparent 40%); + background: linear-gradient(to top, hsl(0 0% 0% / 0.5) 0%, transparent 40%); opacity: 0; transition: opacity 150ms; display: flex; @@ -141,8 +137,8 @@ .favorite-btn { padding: 0.5rem; border-radius: 50%; - background: rgba(255, 255, 255, 0.9); - color: var(--color-muted-foreground, #64748b); + background: hsl(0 0% 100% / 0.9); + color: hsl(var(--color-muted-foreground)); border: none; cursor: pointer; transition: all 150ms; @@ -152,6 +148,6 @@ transform: scale(1.1); } .favorite-btn.favorited { - color: #ef4444; + color: hsl(var(--color-error)); } diff --git a/apps/mana/apps/web/src/lib/modules/photos/components/gallery/PhotoDetailModal.svelte b/apps/mana/apps/web/src/lib/modules/photos/components/gallery/PhotoDetailModal.svelte index 76af6fcc5..5713c56db 100644 --- a/apps/mana/apps/web/src/lib/modules/photos/components/gallery/PhotoDetailModal.svelte +++ b/apps/mana/apps/web/src/lib/modules/photos/components/gallery/PhotoDetailModal.svelte @@ -157,10 +157,12 @@