Skip to content

fix: improve contrast for accessibility#30

Open
pganesh-apphelix wants to merge 1 commit intomainfrom
fix/TNL2-551
Open

fix: improve contrast for accessibility#30
pganesh-apphelix wants to merge 1 commit intomainfrom
fix/TNL2-551

Conversation

@pganesh-apphelix
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings March 20, 2026 09:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Flashcards and Matching game styles to increase visual contrast, aiming to improve accessibility of headings, buttons, and interactive card/choice elements.

Changes:

  • Replaces several theme-token color usages with higher-contrast hex colors for titles/body text.
  • Updates primary button backgrounds/hover colors to a higher-contrast blue.
  • Adjusts Matching “box” borders/backgrounds across default/hover/selected/matched/incorrect states for stronger differentiation.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
games/static/css/matching.css Adjusts text colors and interactive “box” state colors/borders for improved contrast.
games/static/css/flashcards.css Updates text colors, button colors/hover states, and help popover styling for improved contrast.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 211 to 215
.flashcard-left-button:hover:not(:disabled),
.flashcard-right-button:hover:not(:disabled) {
background: var(--light-400, #E1DDDB);
background: #1D4ED8;
transform: scale(1.03);
}
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hover state for the flashcard navigation buttons sets a dark blue background, but the arrow SVGs in games/static/html/flashcards.html use a hard-coded fill="#00262B", so the icon color does not change on hover. This results in insufficient contrast (and a regression from the prior light hover background). Consider styling the SVG/path fill on hover (and ideally :focus-visible) or switching the SVG to fill="currentColor" and setting the button color accordingly.

Copilot uses AI. Check for mistakes.
Comment on lines 271 to 273
.flashcard-help-icon svg {
color: var(--primary-500, #00262B);
color: #1D4ED8;
}
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.flashcard-help-icon svg { color: ... } will not affect the help icon as currently authored: the <path> in games/static/html/flashcards.html has an explicit fill attribute. To actually change the icon color, target fill via CSS (e.g., svg path) or update the SVG markup to use fill="currentColor" and control it via color.

Copilot uses AI. Check for mistakes.

.flashcards-title {
color: var(--primary-500, #00262B);
color: #111827;
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These rules replace themeable var(--primary-500, ...) color tokens with hard-coded hex values. Since the rest of the file still relies on CSS variables with fallbacks (e.g., var(--white, ...), var(--light-200, ...)), this makes it harder for the host platform/theme to override colors. Consider keeping var(...) usage (or defining a local custom property) and only changing the fallback to the higher-contrast value.

Suggested change
color: #111827;
color: var(--gray-900, #111827);

Copilot uses AI. Check for mistakes.

.matching-start-title {
color: var(--primary-500, #00262B);
color: #111827;
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These text colors were changed from themeable var(--primary-500, ...) tokens to hard-coded hex values. Since this stylesheet still uses CSS variables with fallbacks elsewhere, this reduces theming/override flexibility. Consider retaining var(...) (or introducing a local custom property) and updating only the fallback to the desired higher-contrast color.

Suggested change
color: #111827;
color: var(--primary-500, #111827);

Copilot uses AI. Check for mistakes.
Comment on lines 324 to 332
padding: 16px;
overflow: auto;
border-radius: 8px;
border: 2px solid var(--light-300, #F2F0EF);
background: var(--white, #FFFFFF);
border: 2px solid #374151;
background: #F9FAFB;
cursor: pointer;
transition: all 0.2s ease;
text-align: center;
}
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.matching-box is styled as an interactive control (cursor + hover states), but in games/static/html/matching.html it is a clickable <div> (not keyboard focusable by default). For accessibility, consider switching it to a <button> or adding tabindex="0" + appropriate ARIA/keyboard handlers, and add a visible :focus-visible style to match the hover/selected states.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants