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

Add cursor-pointer class for greater accessibility #953

Open
3 tasks done
timgavin opened this issue Jan 4, 2025 · 0 comments
Open
3 tasks done

Add cursor-pointer class for greater accessibility #953

timgavin opened this issue Jan 4, 2025 · 0 comments

Comments

@timgavin
Copy link

timgavin commented Jan 4, 2025

Flux version

v1.1.2

Livewire version

v3.5.18

What is the problem?

Several elements, such as switches, checkboxes, radios, and segmented radio groups would benefit from having the cursor-pointer class applied to them.

The W3C APG shows a pointer on button and checkbox switches, and states:

To help people with visual impairments identify the switch as an interactive element, the cursor is changed to a pointer when hovering over the switch.

There are also examples of pointers on checkboxes and radio groups.

To make it easier to perceive that clicking either the label or checkbox will activate the checkbox, when a pointer hovers over either the checkbox or label, the background color changes, a border appears, and the cursor changes to a pointer

The cursor is changed to a pointer when hovering over the radio button to help people with visual impairments identify it as an interactive element.

The UK gov design guidelines also show pointers over checkboxes and radios. They do not cover switches or toggles.

Code snippets

$classes = Flux::classes()
    ->add('group h-5 w-8 relative inline-flex items-center outline-offset-2')
    ->add('rounded-full')
    ->add('transition')
    ->add('cursor-pointer')
    ->add('bg-zinc-800/15 [&[disabled]]:opacity-50 dark:bg-transparent dark:border dark:border-white/20 dark:[&[disabled]]:border-white/10')
    ->add('[print-color-adjust:exact]')
    ->add([
        'data-[checked]:bg-[var(--color-accent)]',
        'data-[checked]:border-0',
    ])
    ;

How do you expect it to work?

The mouse cursor should change to a pointer when hovering over each element.

Please confirm (incomplete submissions will not be addressed)

  • I have provided easy and step-by-step instructions to reproduce the bug.
  • I have provided code samples as text and NOT images.
  • I understand my bug report will be closed if I haven't met the criteria above.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant