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

a11y improvements for products list section #446

Conversation

migueloller
Copy link
Member

This PR adds various improvements for the products list section, primarily for a11y.

CleanShot 2024-12-31 at 16 40 59@2x

Once we address color contrast issues we should reach a score of 100.

Radix UI's Checkbox primitive renders a button, which means that instead
of `id` and `hmtlFor` the appropriate attribute for a11y is
`aria-labelledby`.

More info on the Checkbox Pattern
[here](https://www.w3.org/WAI/ARIA/apg/patterns/checkbox/).
We were using `asChild` and rendering a `div`. For proper a11y the `div`
needed a role of type `button`. Instead, I opted for removing `asChild`
since Radix UI uses a button by default for accordion items. I had to
tweak some styles to make the button behave like the `div` when it came
to its width.
Changing the minimum and maximum values were triggering changes but the
intent was that those changes would have to first be applied by clicking
the apply button. Furthermore, the logic to determine how to clamp on
blur and when to disable the apply button was being applied on the
parsed result, causing issues in certain edge cases.
Adds missing label props and ensures heading elements are in a
sequentially-descending order.
Copy link

linear bot commented Dec 31, 2024

Copy link

vercel bot commented Dec 31, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
vibes ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 31, 2024 8:43pm

}[colorScheme],
)}
/>
<AccordionsPrimitive.Trigger className="group flex w-full cursor-pointer items-start gap-8 py-3 text-start @md:py-4">
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enable the "Hide whitespace" option for an easier-to-read diff

CleanShot 2024-12-31 at 16 43 54@2x

@migueloller migueloller merged commit 482da9c into main Dec 31, 2024
4 checks passed
@migueloller migueloller deleted the miguel/vib-987-fix-a11y-with-soul-productslistsection-component branch December 31, 2024 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant