source: frontend/node_modules/eslint-plugin-jsx-a11y/docs/rules/no-distracting-elements.md

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 13 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 1.5 KB
Line 
1# jsx-a11y/no-distracting-elements
2
3💼 This rule is enabled in the following configs: ☑️ `recommended`, 🔒 `strict`.
4
5<!-- end auto-generated rule header -->
6
7Enforces that no distracting elements are used. Elements that can be visually distracting can cause accessibility issues with visually impaired users. Such elements are most likely deprecated, and should be avoided. By default, the following elements are visually distracting: `<marquee>` and `<blink>`.
8
9## Rule options
10
11This rule takes one optional object argument of type object:
12
13```json
14{
15 "rules": {
16 "jsx-a11y/no-distracting-elements": [ 2, {
17 "elements": [ "marquee", "blink" ],
18 }],
19 }
20}
21```
22
23For the `elements` option, these strings determine which JSX elements should be checked for usage. This shouldn't need to be configured unless you have a seriously compelling use case for these elements. You cannot add any additional elements than what is offered, as the schema is only valid with the provided enumerated list. If you have another element that you think may cause a11y issues due to visual impairment, please feel free to file an issue or send a PR!
24
25### Succeed
26```jsx
27<div />
28```
29
30### Fail
31```jsx
32<marquee />
33<blink />
34```
35
36## Accessibility guidelines
37- [WCAG 2.2.2](https://www.w3.org/WAI/WCAG21/Understanding/pause-stop-hide)
38
39### Resources
40- [axe-core, marquee](https://dequeuniversity.com/rules/axe/3.2/marquee)
41- [axe-core, blink](https://dequeuniversity.com/rules/axe/3.2/blink)
Note: See TracBrowser for help on using the repository browser.