Repository navigation
Modify Elements Covered by noRedundantRoles #11808
theAdhocracy
started this conversation in
Rule suggestion
Replies: 1 comment
|
Completely agree. I feel like this is a very important distinction. I don't love having to disable this rule on all of my projects, but Tailwind CSS removes list styles by default (with good reason). |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
The current list of elements covered by noRedundantRoles breaks some common accessibility patterns.
The primary one that we run into a lot is
<ul role="list">and<ol role="list">. Whilst these are strictly redundant roles, iflist-styleis modified then some browsers (typically WebKit/Safari) remove the semantics automatically. That can be desirable in certain contexts, but in others problematic, and so it is common to reinstaterole="list"on list elements.See: https://www.scottohara.me/blog/2019/01/12/lists-and-safari.html for a good write up of the issue.
Similarly, other CSS rules can strip semantics in specific contexts, and sometimes these need to be reinstated. Whilst rarer, some codebases end up relying on those tricks.
It would be very useful to have a way to override the rule on a per-project basis, or remove specific elements like
<ol>and<ul>. We'd like to keep noRedundantRoles enabled, as we do find developers still using outdated patterns, but further control would be useful.I'm thinking of something akin to:
All reactions