Skip to content

Conversation

@mmamedel
Copy link

@mmamedel mmamedel commented Dec 1, 2025

This usePrefersDark utility provides a reactive boolean that reflects whether the user prefers dark mode based
on their browser or OS settings. It uses the prefers-color-scheme media query and updates automatically when the preference changes.

@changeset-bot
Copy link

changeset-bot bot commented Dec 1, 2025

⚠️ No Changeset found

Latest commit: 1dbc6a0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@mmamedel mmamedel changed the title feat(usePrefersColorScheme): add utility export feat(usePrefersDark): add utility export Dec 1, 2025
@TGlide
Copy link
Member

TGlide commented Dec 20, 2025

Thanks for the PR! I think usePrefersColorScheme would be better imo, similar to https://vueuse.org/core/usePreferredColorScheme/#usepreferredcolorscheme

@TGlide
Copy link
Member

TGlide commented Dec 20, 2025

also a class would be better here

@mmamedel
Copy link
Author

Made some changes to align it closer to the VueUse implementation.

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

Successfully merging this pull request may close these issues.

2 participants