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

perf(a11y): add aria-checked attribute to switch #644

Merged
merged 5 commits into from
Aug 31, 2022

Conversation

kecrily
Copy link
Contributor

@kecrily kecrily commented May 23, 2022

Use the dark switch provided by vueuse and add the aria-checked attribute to the switch

@kiaking
Copy link
Member

kiaking commented May 23, 2022

Thanks for the pr!

@yyx990803 Do you remember why we stop using Vueuse for Dark mode control? I remember initially, we're using Vueuse dark mode feature, and then we swtiched to creating the original one in Vue.js website.

Was it due to trying to reduce dependencies? If so, we're already using Vueuse for useMediaQuery so maybe we could reuse Vueuse for the dark theme as well? 🤔

@kiaking kiaking added the enhancement New feature or request label May 23, 2022
@kiaking
Copy link
Member

kiaking commented May 30, 2022

@kecrily OK, let's not use vueuse for now. We can simply apply the aria label with current useAppearance function. Would you mind updating the code 👀

@kiaking kiaking changed the base branch from next-theme to main June 6, 2022 04:16
kiaking
kiaking previously requested changes Jun 6, 2022
Copy link
Member

@kiaking kiaking left a comment

Choose a reason for hiding this comment

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

This will fail on Build 😢 Because window and localStorage will be undefined during the build time. We need to do a bit more complicated stuff here.

@brc-dd brc-dd marked this pull request as draft August 31, 2022 04:06
@brc-dd brc-dd marked this pull request as ready for review August 31, 2022 04:56
@brc-dd brc-dd merged commit eb9026d into vuejs:main Aug 31, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants