Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/styles/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 4 additions & 1 deletion test/slm.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
Loading