Skip to content

Implement accessibility based on ARIA practices #57

@web-padawan

Description

@web-padawan

Hello 👋
I've been thinking about making the color picker accessible, and I would like to discuss the related changes.

It looks like for Hue and Alpha sliders we can follow WAI-ARIA authoring practices. See also the example.
I'm not an expert, but presumably the same approach should work for Saturation as well.

There are following open questions that come to my mind:

  1. Implementing this would require to figure out what the proper step value per arrow key press should be.
    Should we make this step configurable? Maybe not as pubic property, but a protected one.

  2. Note that Page Up and Page Down allow to change value by multiple steps (10 steps in the example).
    Should this be configurable as well?

  3. Proper support for screen reader announcements would require to provide a way for setting aria-label on the pointer elements. It could be done either with individual props or by passing an object with the following structure:

i18n: {
  alpha: 'Alpha',
  hue: 'Hue',
  saturation: 'Saturation'
}

I'm going to prototype some of these changes in vanilla-colorful so I will create an issue there as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions