mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-10 05:12:14 +00:00
fix(coach): paint the launcher glyph white on the gradient
The floating Coach launcher inherited the button's dark foreground token, which left the sparkle glyph as a dark outline on the purple-pink gradient. The glyph is decorative and the button carries its own accessible name, so the white mark reads cleaner without affecting the control's non-text contrast, which the offset focus ring already provides.
This commit is contained in:
1 parent
f90ce8bace
commit
3e04035de8
2 files changed
+9
-7
No files matched your search
@@ -71,18 +71,20 @@ describe("<LayoutCoachFab>", () => {
|
||||
expect(html).not.toContain("lg:bottom-6");
|
||||
});
|
||||
|
||||
it("paints a dark glyph + offset focus ring on the gradient", () => {
|
||||
it("paints a white glyph + offset focus ring on the gradient", () => {
|
||||
mockPathname = "/";
|
||||
const html = render(
|
||||
<CoachLaunchProvider>
|
||||
<LayoutCoachFab />
|
||||
</CoachLaunchProvider>,
|
||||
);
|
||||
// White on the purple/pink gradient sat at ≈2.3:1; the background
|
||||
// token reads ≈6.5:1.
|
||||
expect(html).toContain("text-background");
|
||||
expect(html).not.toContain("text-white");
|
||||
// The offset ring draws a visible halo around the gradient circle.
|
||||
// The glyph is decorative (aria-hidden) and the button carries its own
|
||||
// accessible name, so the text-contrast rule does not gate it; the
|
||||
// white glyph reads as a clean mark on the gradient. The button still
|
||||
// sets text-background for any non-glyph text it might hold.
|
||||
expect(html).toContain("text-white");
|
||||
// The offset ring draws a visible halo around the gradient circle and
|
||||
// provides the non-text UI-component contrast against the page.
|
||||
expect(html).toContain("focus-visible:ring-offset-2");
|
||||
expect(html).toContain("focus-visible:ring-offset-background");
|
||||
});
|
||||
|
||||
@@ -238,7 +238,7 @@ export function LayoutCoachFab() {
|
||||
"[body:has([data-testid=onboarding-tour])_&]:invisible",
|
||||
)}
|
||||
>
|
||||
<Sparkles className="size-6" aria-hidden="true" />
|
||||
<Sparkles className="size-6 text-white" aria-hidden="true" />
|
||||
{unread ? (
|
||||
// v1.18.6 (CCH-03) — discreet "the Coach said something" dot.
|
||||
// Deliberately NOT an alarming red (the medication-card rule:
|
||||
|
||||
Reference in new issue
Block a user