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

[css-color] Keyboard operability for the previews #7687

Closed
matatk opened this issue Sep 4, 2022 · 3 comments
Closed

[css-color] Keyboard operability for the previews #7687

matatk opened this issue Sep 4, 2022 · 3 comments
Assignees
Labels
css-color-5 Color modification

Comments

@matatk
Copy link

matatk commented Sep 4, 2022

This comment is from the APA WG and relates to our review of CSS Color Module Level 5.

The color previews can be hovered over with the mouse. When this happens, they enlarge, covering some of the text behind. This is particularly useful if the preview is of a transparent color, as the text behind shows through the preview window. It is not possible to activate the preview with the keyboard, so keyboard-only users would likely miss out on this helpful feature.

@svgeesus svgeesus added the css-color-5 Color modification label Sep 5, 2022
@svgeesus svgeesus mentioned this issue Sep 5, 2022
5 tasks
@svgeesus
Copy link
Contributor

svgeesus commented Oct 5, 2022

@LeaVerou any thoughts on adding keyboard triggering of the hover behaviour?

@LeaVerou
Copy link
Member

LeaVerou commented Oct 5, 2022

We just need to make it focusable (e.g. by adding tabindex), and then use :is(:hover, :focus) instead of :hover.

We could even write script to make them focusable en masse:

for (let swatch of document.querySelectorAll(".swatch") swatch.setAttribute("tabindex", "0");

@svgeesus
Copy link
Contributor

svgeesus commented Oct 5, 2022

That sounds good, want to do it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css-color-5 Color modification
Projects
None yet
Development

No branches or pull requests

3 participants