dequelabs / dequelabs/axe-core

Color contrast should ignore overlapping elements that have transparent background

Open
#3,464 12 comments 6 reactions 0 assignees View on GitHub
color contrast fix pr
Dominant language
JavaScript
Stars
7.5k
Forks
933
Avg merge
2d 13h
Merged PRs (30d)
29

Description

Take the following example:

```html

.overlap {
position: absolute;
top: 0;
left: 0;
width: 100px;
height: 100px;
}

Hello World


```

This causes an incomplete result for color contrast because the `.overlap` element is on top of the `` element in the DOM stack. However since the `.overlap` element has a transparent background it should just be ignored.

This same problem happens with [Material Button components](https://material.io/components/buttons) due to the ripple effect element that overlaps the button text.

```html

Button

```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the provided HTML examples, including the Material Button markup, with axe-core's color-contrast check. Trace how overlapping elements are handled and verify that transparent overlays no longer make the result incomplete while opaque overlaps still affect it.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
accessibility
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.