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

expose "system" color mode #543

Open
teidesu opened this issue Jan 18, 2025 · 0 comments
Open

expose "system" color mode #543

teidesu opened this issue Jan 18, 2025 · 0 comments

Comments

@teidesu
Copy link

teidesu commented Jan 18, 2025

Is your feature request related to a problem? Please describe.
currently it's not possible to easily implement checkmarks in a color mode switcher like this:

Image

because colorMode accessor only returns a dark/light value, and not whether it's currently linked to system color scheme. in other words, there isn't an easy way to know if setColorMode('system') was called

Describe the solution you'd like
a relatively easy way to implement this would be to expose isSystemMode() accessor in the context.
alternatively, colorMode() could return 'dark' | 'light' | 'system', but that would be a breaking change

Describe alternatives you've considered
currently we have to do crutches involving manually reading data from localStorageManager to implement this, which is definitely not ideal

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