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

feat(enhancement): use system dark mode #458

Merged
merged 2 commits into from
Jun 18, 2023
Merged

feat(enhancement): use system dark mode #458

merged 2 commits into from
Jun 18, 2023

Conversation

rmtsrc
Copy link
Contributor

@rmtsrc rmtsrc commented Jun 18, 2023

Currently by default it-tools is shown using the dark theme and does not change based on the current system dark mode setting.

I often find myself toggling the system light theme during the day and the dark mode at night. Most browsers, websites and my IDE all automatically update to reflect the system setting.

This PR switches over to useDark (from Vue.use), which takes into account your system theme settings (via the prefers-color-scheme CSS matcher). This PR also removes duplicate code in src/ui/theme/theme.store.ts.

Screencast.from.2023-06-18.09-26-58.webm

@vercel
Copy link

vercel bot commented Jun 18, 2023

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

Name Status Preview Updated (UTC)
it-tools ✅ Ready (Inspect) Visit Preview Jun 18, 2023 8:45am

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Owner

@CorentinTh CorentinTh left a comment

Choose a reason for hiding this comment

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

Hi !
Thank you for the improvement, that's indeed a nice improvement 🙏🏻
I planned to remove the theme store, the duplication of the dark mode boolean was a stupid thing

Great PR with the video 👌🏻

@CorentinTh CorentinTh enabled auto-merge (squash) June 18, 2023 08:56
@CorentinTh CorentinTh merged commit cf7b1f0 into CorentinTh:main Jun 18, 2023
@rmtsrc rmtsrc deleted the prefers-color-scheme branch June 18, 2023 09:06
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