Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: Improve Accessibility and Semantics of Term Representation Element #492

Open
martyanovandrey opened this issue Aug 27, 2024 · 0 comments

Comments

@martyanovandrey
Copy link
Contributor

martyanovandrey commented Aug 27, 2024

We currently use an <i> tag for representing terms in YFM. This tag primarily serves stylistic purposes and doesn't fully convey the semantic meaning or interactive capabilities of the element and impacting accessibility.

The current role=term does not convey the interactivity of the element, role=button would work better in this case. And in order for the terms to be selectable from the keyboard, an tabindex has already been added what is the default behavior for the button.

Proposal

I propose that we refactor our term representation element to use more semantic and accessible HTML tag such as <button> for interactive elements that trigger actions.

Current:

<i class="yfm yfm-term_title" term-key=":term" role="term" aria-describedby=":term_element" tabindex="0" id="bwzu8pkn">term</i>

Proposal:

<button class="yfm yfm-term_title" term-key=":term" aria-describedby=":term_element" id="bwzu8pkn">term</button>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant