|
23 | 23 | } |
24 | 24 |
|
25 | 25 | /* W0017: Interactive Elements should not have aria-hidden */ |
| 26 | +$interactive-elements: ("a", "button", "summary", '[role="separator"][aria-valuenow]', '[role="separator"][aria-valuemin]', '[role="separator"][aria-valuemax]'); |
26 | 27 |
|
27 | | -$interactive-roles: ("button", "combobox", "link", "menuitem", "menuitemcheckbox", "menuitemradio", "option", "scrollbar", "searchbox", "slider", "spinbutton", "switch", "tab", "radio", "textbox", "treeitem"); |
28 | | - |
29 | | -@each $role in $interactive-roles { |
30 | | - [role="#{$role}"][aria-hidden="true"]::after { |
| 28 | +@each $el in $interactive-elements { |
| 29 | + #{$el}[aria-hidden="true"]::after { |
31 | 30 | @include contentMessage(warning, "W0017", "Interactive element containing aria-hidden"); |
32 | 31 | } |
33 | 32 | } |
34 | 33 |
|
35 | | -a, |
36 | | -button, |
37 | | -summary, |
38 | | -[role="separator"][aria-valuenow], |
39 | | -[role="separator"][aria-valuemin], |
40 | | -[role="separator"][aria-valuemax] { |
41 | | - &[aria-hidden="true"]::after { |
42 | | - @include contentMessage(warning, "W0017", "Interactive element containing aria-hidden"); |
| 34 | +$interactive-tags: ("area", "audio[controls]", "iframe", "input", "select", "textarea", "video[controls]"); |
| 35 | + |
| 36 | +@each $tag in $interactive-tags { |
| 37 | + #{$tag}[aria-hidden="true"] { |
| 38 | + @include vectorMessage(warning, "W0017", 350, "Interactive", "element containing aria-hidden"); |
43 | 39 | } |
44 | 40 | } |
45 | 41 |
|
46 | | -area, |
47 | | -audio[controls], |
48 | | -iframe, |
49 | | -input, |
50 | | -select, |
51 | | -textarea, |
52 | | -video[controls] { |
53 | | - &[aria-hidden="true"] { |
54 | | - @include vectorMessage(warning, "W0017", 350, "Interactive", "element containing aria-hidden"); |
| 42 | +$interactive-roles: ("button", "combobox", "link", "menuitem", "menuitemcheckbox", "menuitemradio", "option", "scrollbar", "searchbox", "slider", "spinbutton", "switch", "tab", "radio", "textbox", "treeitem"); |
| 43 | + |
| 44 | +@each $role in $interactive-roles { |
| 45 | + [role="#{$role}"][aria-hidden="true"]::after { |
| 46 | + @include contentMessage(warning, "W0017", "Interactive element containing aria-hidden"); |
55 | 47 | } |
56 | 48 | } |
0 commit comments