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

updated system theme: #102

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sumukhj1219
Copy link

No description provided.

@sumukhj1219
Copy link
Author

can you check once

Copy link
Owner

@afadil afadil left a comment

Choose a reason for hiding this comment

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

System theme selection is not solved by this PR. At least it doesnt work on macos
I think window.matchMedia("(prefers-color-scheme: dark)").matches is not working for Tauri app.
My be this is what the following plugin try to solve: https://github.com/wyhaya/tauri-plugin-theme

@@ -40,6 +40,7 @@
"date-fns": "^3.6.0",
"lodash": "^4.17.21",
"lucide-react": "^0.436.0",
"next-themes": "^0.3.0",
Copy link
Owner

Choose a reason for hiding this comment

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

We dont need next-themes (I think this is for Nextjs app)

</div>
</div>
<span className="block w-full p-2 text-center font-normal">Dark</span>
</FormLabel>
</FormItem>

<FormItem>
Copy link
Owner

Choose a reason for hiding this comment

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

better use a half/half visualisation. something like this:
<FormItem> <FormLabel className="[&:has([data-state=checked])>div]:border-primary"> <FormControl> <RadioGroupItem value="system" className="sr-only" /> </FormControl> <div className="items-center rounded-md border-2 border-muted p-1 hover:border-accent"> <div className="flex rounded-sm"> <div className="w-1/2 space-y-2 rounded-l-sm bg-[#ecedef] p-2"> <div className="space-y-2 rounded-md bg-white p-2 shadow-sm"> <div className="h-2 w-[80px] rounded-lg bg-[#ecedef]" /> <div className="h-2 w-[100px] rounded-lg bg-[#ecedef]" /> </div> <div className="flex items-center space-x-2 rounded-md bg-white p-2 shadow-sm"> <div className="h-4 w-4 rounded-full bg-[#ecedef]" /> <div className="h-2 w-[100px] rounded-lg bg-[#ecedef]" /> </div> </div> <div className="w-1/2 space-y-2 rounded-r-sm bg-slate-950 p-2"> <div className="space-y-2 rounded-md bg-slate-800 p-2 shadow-sm"> <div className="h-2 w-[20px] rounded-lg bg-slate-400" /> <div className="h-2 w-[30px] rounded-lg bg-slate-400" /> </div> <div className="flex items-center space-x-2 rounded-md bg-slate-800 p-2 shadow-sm"> <div className="h-4 w-4 rounded-full bg-slate-400" /> <div className="h-2 w-[100px] rounded-lg bg-slate-400" /> </div> </div> </div> </div> <span className="block w-full p-2 text-center font-normal">System</span> </FormLabel> </FormItem>

// Define the types for themes
type Theme = "light" | "dark" | "system";

export default function useTheme() {
Copy link
Owner

Choose a reason for hiding this comment

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

this file should be removed as it's not used. Similar logic is already in settings-provider.

Copy link
Author

Choose a reason for hiding this comment

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

I'll try to resolve it

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