﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
37533	Admin calendar and time picker hover/focus style has insufficient contrast in the light theme	Alin Morosanu		"In the admin's calendar and time picker, a hovered or keyboard-focused day or time is shown with white text on `var(--primary)`, which is `#79aec8` in the light theme. That's a contrast ratio of 2.41:1, below the WCAG 2.1 AA minimum of 4.5:1 for normal text ([https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html SC 1.4.3]). Calendar days are 12px and time options 13px, both normal weight.

Both use the same rule in `django/contrib/admin/static/admin/css/widgets.css` (unchanged at c67d872765 on main):
{{{
.calendar td a:focus,
.timelist a:focus,
.calendar td a:hover,
.timelist a:hover {
    background: var(--primary);
    color: white;
}
}}}

Computed colours on the demo at https://thibaudcolas.github.io/django_admin_tests/latest/english/admin/auth/user/1/change/ (Django 6.2.dev20261022174430), Chromium 143 on macOS, light theme: white on #79aec8 for both hover and keyboard focus, on a calendar day and on a time option. On current main (c67d872765, run locally in Firefox), a time option reached with Tab has computed white on #79aec8, and Firefox's accessibility inspector shows 2.41 on hover for both a calendar day and a time option. In the dark theme, the same hover/focus pair is white on #264b5d (9.35:1).

Steps to reproduce:
 1. Open a change form with a date and time field in the light theme, for example a user's ""Last login"".
 2. Open the calendar (calendar icon) or the time picker (clock icon), then hover over a day or time, or Tab to one.

Related: #34036 moved `.calendar td.selected a` to `var(--secondary)` but left this rule. [https://github.com/django/django/pull/12967 PR #12967] (for #31617, closed) proposed #609ab6 for this rule, which would still be about 3.09:1. #36192 ([https://github.com/django/django/pull/21350 PR #21350]) changes these selectors from `a` to `button`, so a fix would touch the same lines.

Thibaud Colas pointed this out to me on Discord. I'm a Djangonaut in Session 7 and would like to work on it.
"	Bug	new	contrib.admin	dev	Normal		accessibility		Unreviewed	0	0	0	0	0	1
