GoogleChrome / lighthouse

Automated auditing, performance metrics, and best practices for the web.
https://developer.chrome.com/docs/lighthouse/overview/
Apache License 2.0
28.22k stars 9.35k forks source link

Audit for disabling text selection #10122

Open connorjclark opened 4 years ago

connorjclark commented 4 years ago

inspired by https://news.ycombinator.com/item?id=21804316

Like font-size does, we could flag pages that have >X% of text w/ text selection disabled. This feature is antagonistic to the user. We should leave some room for unselectable text, as there are some use cases for it, but in general that should be a fraction of the text on the page.

We may way to generalize FontSize to a Text artifact.

Malvoz commented 4 years ago

It is possible to make selectable text look like it isn't selectable, using the combined declaration:

::selection {
  color: inherit;
  background-color: inherit;
}

which should be considered as well.

there are some use cases for it

I've personally used it myself, for CTA links.

Malvoz commented 4 years ago

Another case of frustration can be experienced at https://web.dev/ - while the site doesn't use user-select: none nor the declaration described above - there's a lot of content contained within regular <a> links to make up "cards", making the content within unselectable.

As this is an accessibility issue, I wonder if it'd be better to raise this in aXe?