Inclusive-Design-Principles / inclusive-design-principles

5 stars 4 forks source link

Avoid ARIA label as CSS selector #18

Open christophdubach opened 7 months ago

christophdubach commented 7 months ago

Currently CSS selectors like nav[aria-label="page"] are used.

Since the value of the aria-label attribute should be translated, the CSS selector must be adjusted accordingly when adding another language.

nav[aria-label="page"],
nav[aria-label="Seite"],
nav[aria-label="pagina"],
nav[aria-label="foo"] {

This could lead to errors as someone could forget to make this adjustment So it might make sense to add a class to the <nav> element instead of using aria-label as a selector.