diff --git a/app/assets/tailwind/application.css b/app/assets/tailwind/application.css index 3d868c741..ddbda9b04 100644 --- a/app/assets/tailwind/application.css +++ b/app/assets/tailwind/application.css @@ -188,6 +188,20 @@ scrollbar-width:none } +/* Tinted-bg + colored-content avatar used by Goals::AvatarComponent and + the goals color/icon picker. Theme-aware text color: light mode darkens + the letter/icon so pale palette entries (cyan-300, green-300, etc.) keep + ~4.5:1 contrast against the 10%-mix tint over white. Dark mode reverts + to the full color so the letter doesn't disappear against the near-black + surface. */ +.goal-avatar { + background-color: color-mix(in oklab, var(--avatar-color) 10%, transparent); + color: color-mix(in oklab, var(--avatar-color) 55%, black); +} +[data-theme="dark"] .goal-avatar { + color: var(--avatar-color); +} + .invite_code [data-clipboard-target="iconDefault"], .invite_code [data-clipboard-target="iconSuccess"] { transition: opacity 0.2s; diff --git a/app/components/goals/avatar_component.html.erb b/app/components/goals/avatar_component.html.erb index 7cb9d7a09..f91284c68 100644 --- a/app/components/goals/avatar_component.html.erb +++ b/app/components/goals/avatar_component.html.erb @@ -1,5 +1,5 @@ -