facebook / docusaurus

Easy to maintain open source documentation websites.
https://docusaurus.io
MIT License
56.95k stars 8.57k forks source link

Contrast error on invisible hash anchor link #10634

Open rebekaburnett opened 1 month ago

rebekaburnett commented 1 month ago

Have you read the Contributing Guidelines on issues?

Prerequisites

Description

The hash links (the invisible markers immediately following each heading) are throwing contrast errors. If you add an aria label of hidden, it should fix that. (see attachment)

Reproducible demo

No response

Steps to reproduce

You can see the error by installing the WAVE extension in Chrome and enabling it (click the little W button in the header) when you're on one of the Docusaurus pages which have headers (e.g., https://docusaurus.io/docs)

Expected behavior

Expect to not get any of the errors in the scans.

Actual behavior

3-wave-hash-link

Your environment

Self-service

rebekaburnett commented 3 weeks ago

I tested it locally, and it seemed to work to add the visibilitytag to the hash-link style.

:global(.hash-link) {
  opacity: 0;
  visibility: hidden;
  ...
}

:global(.hash-link:focus),
:global(*:hover > .hash-link) {
  opacity: 1;
  visibility: visible;
}