v6-alpha-1. Accessibility color contrast on primrary button and links.

Open
#43,025 1 comment 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
57/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
bootstrap, css, sass, scss

Research direction

Start at the Bootstrap 6 button playground linked in the issue and inspect the primary button, light mode links, success backgrounds, and dark mode pagination disabled color. Compare their text and background contrast with the stated WCAG 2.2 AA 4.5:1 threshold; the issue suggests --bs-blue-600 for primary. Done when the affected combinations meet the stated contrast requirement.

Written by the indexing model from the issue text.

Description

accessibility bug color-mode confirmed css v6
Prerequisites
Describe the issue

WCAG 2.2 AA contrast guide: https://www.w3.org/WAI/WCAG22/Understanding/contrast-minimum.html

Bootstrap 6-alpha1's default primary color (#0087fe) only gives 3.56:1 contrast against white text, failing the a11y check, which expects 4.5:1. This affects both buttons and light-mode links.

Other places;

  • white text on Bootstrap 6's success bg (green-500) is under 4.5:1
  • The default dark-mode disabled color (gray-500) is just under 4.5:1 on the pagination background

Possible solution: --bs-blue-600 gives ~5.9:1 contrast

  --bs-primary-base: var(--bs-blue-600);
  --bs-primary-bg: var(--bs-blue-600);
Reduced test cases

Just go to https://getbootstrap.com/docs/6.0/components/button/#playground

What operating system(s) are you seeing the problem on?

macOS

What browser(s) are you seeing the problem on?

Firefox

What version of Bootstrap are you using?

6.0.0.alpha1

Dominant language
MDX
Stars
175k
Forks
78.7k
Avg merge
1d 7h
Merged PRs (30d)
103

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from twbs/bootstrap

All issues in twbs/bootstrap

Similar issues

More Accessibility issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.