-
Notifications
You must be signed in to change notification settings - Fork 791
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Color contrast should ignore overlapping elements that have transparent background #3464
Comments
We should look into restricting exactly what is ignored, as images or iframes that overlap won't have a background color but will interfere with the element. So possible solution is to ignore the element if it meets all of the following conditions:
|
It also can't have CSS filters, thick border, pseudo elements, embedded graphical content like img, canvas, object. There are a ton of ways in which something that at first glance may seem like an empty div, for it to have an impact on content that's behind it. I think that 9 out of 10 times when we see a transparent element on top of text content, it's there to have some kind of effect on things that are behind it. Why would people put completely empty divs on top of their content? |
A good example of this is the home page of https://arstechnica.com/. They use empty anchor tags with We could scope the requirement to ignore the element based on:
|
Another place this happens on is Material Inputs https://material.angular.io/components/input/overview. The inputs each contain a span which in turn contains the label element for the input. The span overlaps the input, but the label does not. Since the span itself has no background and no direct text children, we should ignore it as well. |
Validated with the latest develop branch code base, for the test script:
This snippet is giving an and with the below test script:
the ripple effect element that overlaps the button text, so it is passing |
I know this was closed some time ago, but is there any chance to revive #3583 in order to prevent incomplete tests? 😕 |
This was closed by mistake. We're going to look at this again. |
Thanks! 🙏 |
please, fix this! |
#7348) #### Details This feature is to bind V8 theme for existing Fluent ui components and V9 for new Fluent Ui components (next feature). - So as part of Fluent UI V9 migration, we will not migrate entire components from V8 to V9, as we are following migration in incremental approach as V9 is also in development from fluent team. - So to accommodate V8 and V9 components UI designs, we created V8 and V9 theme wrapped in root. So that V8 components will pickup v8 theme and V9 components (NEXT FEATURE) will pickup V9 theme. - This feature also covers, high contrast themes for both v8 and v9 themes. - Updated to latest V9 Fluent version @fluentui/react-components to 9.x.x - Removed loadTheme from V8, as we are using theme as Wrapper instead of calling function. - Created custom V9 Dark theme to accommodate high contrast option. **Updated below test cases :** src/tests/end-to-end/tests/details-view/headings.test.ts src/tests/end-to-end/tests/details-view/reflow-ui.test.ts During e2e test cases encountered below errors for above 2 files: ![GetImage](https://github.com/microsoft/accessibility-insights-web/assets/155614445/96db2b81-389e-4537-b550-5bf5656b686a) So from investigation, we can observe its false positive for high contrast, and there is existing issues reported for transparent background. dequelabs/axe-core#3464 And the issue we are seeing is with **Assessment link** in high contrast mode, inspecting this link in high contrast mode, we can see background is in transparent. - Removed loadTheme test case, as we are not using loadTheme anymore. ##### Motivation To keep AI Web to accommodate both V8 and V9 components with respective theme. ##### Context #### Pull request checklist <!-- If a checklist item is not applicable to this change, write "n/a" in the checkbox --> - [ ] Addresses an existing issue: #0000 - [x] Ran `yarn fastpass` - [x] Added/updated relevant unit test(s) (and ran `yarn test`) - [x] Verified code coverage for the changes made. Check coverage report at: `<rootDir>/test-results/unit/coverage` - [x] PR title *AND* final merge commit title both start with a semantic tag (`fix:`, `chore:`, `feat(feature-name):`, `refactor:`). See `CONTRIBUTING.md`. - [x] (UI changes only) Added screenshots/GIFs to description above - [ ] (UI changes only) Verified usability with NVDA/JAWS
Hello from Material! We're running into this bug and it's suppressing color-contrast violations as incomplete due to our invisible touch target. I create a repro here: https://jsbin.com/diqacijawi/edit?html,output. Minimal html: <style>
button {
background: lightblue;
color: green;
/* place touch target in center */
position: relative;
display: grid;
}
.touch-target {
outline: 1px dashed green;
height: 48px;
width: 100%;
position: absolute;
place-self: center;
}
</style>
<button id="invalid-color-no-touch-target">
Invalid color (caught)
</button>
<button id="invalid-color-with-touch-target">
Invalid color + touch (incomplete, missed)
<div class="touch-target"></div>
</button> The reason for this floating empty element is to extend the "touch area" for a component on mobile for accessibility. The increased area helps users click on elements that are smaller than 48px. |
Take the following example:
This causes an incomplete result for color contrast because the
.overlap
element is on top of the<span>
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 due to the ripple effect element that overlaps the button text.
The text was updated successfully, but these errors were encountered: