WordPress / playground-tools

GNU General Public License v2.0
127 stars 38 forks source link

Playground block: A11Y: Use better labels for buttons #288

Open alexstine opened 3 weeks ago

alexstine commented 3 weeks ago

Test page: https://learn.wordpress.org/test/wordpress-playground-block-plugin-test-page/

The following buttons could use better labels.

It is not clear that these buttons will switch the code editor view. Suggestions:

Since these are functioning similarly to tabs, I would also mark the active one. You can use aria-current="true". This attribute must also be toggled with JavaScript with onClick event or similar.

Docs:

  1. https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current
  2. https://a11ysupport.io/tech/aria/aria-current_attribute