saas-starter icon indicating copy to clipboard operation
saas-starter copied to clipboard

Add dark mode

Open jacobhq opened this issue 1 year ago • 8 comments

Adds dark mode to all marketing and dashboard pages. Closes #44.

jacobhq avatar Sep 21 '24 10:09 jacobhq

@jacobhq is attempting to deploy a commit to the leerob-site Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Sep 21 '24 10:09 vercel[bot]

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

Name Status Preview Comments Updated (UTC)
next-saas-starter ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 3, 2024 4:25pm

vercel[bot] avatar Sep 21 '24 19:09 vercel[bot]

I don't know what has happened with the lock file diff, it says I added zod to the lockfile, whereas that also exists in main.

jacobhq avatar Sep 21 '24 20:09 jacobhq

CleanShot 2024-09-21 at 19 06 52@2x

Dashboard styles are missing dark mode styles.

leerob avatar Sep 22 '24 00:09 leerob

Are you still wanting to continue with this PR? The dashboard still does not work with dark mode. Lmk 🙏

leerob avatar Nov 01 '24 21:11 leerob

Hi Lee, I can't see what the problem is at the moment. Here's what I can see on my machine. Are there any specific problems that I am missing. Thanks for you patience :) image

jacobhq avatar Nov 01 '24 22:11 jacobhq

I still see this on my machine: https://github.com/leerob/next-saas-starter/pull/45#issuecomment-2365370970

leerob avatar Nov 02 '24 16:11 leerob

Try this on your machine - I noticed some weirdness with screen sizes. I tried simulating a 24" iMac in devtools, but it did not seem to affect styles. To remove the variable of differing machines, please could you take a look at this depolyment: https://next-saas-starter-git-1bb03f-jacob-marshalls-projects-01797007.vercel.app/dashboard/activity?_vercel_share=Ml10bUdPcxqhEGGD5FlkfsfykEz6AV74? You should be able to comment/highlight etc. on there with Vercel Toolbar.

jacobhq avatar Nov 02 '24 22:11 jacobhq

// Get the theme toggle button const toggleButton = document.getElementById("theme-toggle");

// Check and apply saved theme preference from localStorage const savedTheme = localStorage.getItem("theme"); if (savedTheme) { document.documentElement.setAttribute("data-theme", savedTheme); toggleButton.textContent = savedTheme === "dark" ? "Switch to Light Mode" : "Switch to Dark Mode"; }

// Toggle theme on button click toggleButton.addEventListener("click", () => { const currentTheme = document.documentElement.getAttribute("data-theme"); const newTheme = currentTheme === "dark" ? "light" : "dark";

// Apply the new theme document.documentElement.setAttribute("data-theme", newTheme); toggleButton.textContent = newTheme === "dark" ? "Switch to Light Mode" : "Switch to Dark Mode";

// Save the theme preference to localStorage localStorage.setItem("theme", newTheme); });

sanjomathew09 avatar Jan 26 '25 14:01 sanjomathew09

I still see this on my machine: #45 (comment)

Can you just please merge this solution: https://github.com/nextjs/saas-starter/pull/56

Because it seems cleaner and works better than the current pull request. It’s been years, and I can’t believe dark mode is still not implemented. Thanks!

syntaxsurge avatar Feb 12 '25 10:02 syntaxsurge

@syntaxsurge please test on your machine. I am unable to reproduce Lee's issue.

This PR works fine as far as I can tell. I think Lee did not want a toggle, so that's why he chose this PR.

image

Why? Their solution is different, and I would say that the solution in this PR is better than the one you mentioned. It’s been years, and I can’t believe dark mode is still not implemented.

I see - the other one uses foreground etc. - next time, please just say that with code review.

It’s been years, and I can’t believe dark mode is still not implemented.

Hyperbole is not productive. Please give specific feedback.

jacobhq avatar Feb 12 '25 14:02 jacobhq

image image Dark mode is not working for me

syntaxsurge avatar Feb 13 '25 06:02 syntaxsurge