diff --git a/src/styles/style.css b/src/styles/style.css index 7a17170..56eee0f 100644 --- a/src/styles/style.css +++ b/src/styles/style.css @@ -814,10 +814,13 @@ a:hover { .btn-assistant { background: var(--agent-purple-dark); border-color: var(--agent-purple-dark); - color: #ffffff; + color: var(--control-fg-on-emphasis, #ffffff); } .btn-assistant:hover:not(:disabled) { - background: var(--agent-purple); + /* Dark mode's --agent-purple is a light lavender meant for text/accents, + not a button fill with light text, so hover darkens instead of + switching to it (fixes a ~1.9:1 contrast failure). */ + filter: brightness(1.12); } .btn-assistant:disabled { background: var(--agent-purple-dark); diff --git a/test/slm.test.js b/test/slm.test.js index c512834..1a86dea 100644 --- a/test/slm.test.js +++ b/test/slm.test.js @@ -543,8 +543,11 @@ describe('assistant markup', () => { const hoverStart = css.indexOf('.btn-assistant:hover:not(:disabled) {'); expect(hoverStart).toBeGreaterThan(-1); + // Hover brightens the base fill rather than swapping to --agent-purple, + // since that token is a light lavender in dark mode and would fail + // WCAG contrast against the button's white/dark text. const hoverRule = css.slice(hoverStart, css.indexOf('}', hoverStart)); - expect(hoverRule).toContain('var(--agent-purple)'); + expect(hoverRule).toContain('brightness'); }); it('announces status updates to assistive technology', () => {