Website Theme not working

PLEASE help us help you by writing a good post!

  • We need to know your netlify site name. Example: gifted-antelope-58b104.netlify.app
  • DNS issues? Tell us the custom domain, tell us the error message! We can’t help if we don’t know your domain.
  • Build problems? Link or paste the FULL build log & build settings screenshot
  • Did you try Ask Netlify, our generative AI chatbot, before posting? It pulls info from Support Guides and recent solved forums posts.

The better the post - the faster the answer.

I deployed a build at lka.netlify.app. It defaults to dark mode, and the light mode button isn’t working on all pages.
However, on 404 pages like https://lka.netlify.app/categories and lka.netlify.app/tags, it initially shows dark mode but then switches to light mode. Please check.

I also observed that this problem do not exist in local host.

I checked. I cannot replicate. This is not something done by Netlify.

Can you open https://lka.netlify.app and see the behaviour. It opens in dark mode by default. and also the theme change icon is not operatable.

As I said previously

In case you didn’t understand, that means I opened the URL to verify the behaviour and was unable to verify it. This means the page opened in dark mode and stayed in dark mode.

I’m the same. I can’t replicate perhaps your CMS is off?

Absolutely,

Right Case: it should be showing light mode and only when user clicks on icon theme icon it should change to dark theme.

Failure Case: You observed that is opening dark mode by default and it stayed like wise.

I am wondering about this since i didn’t see failure case when i run it in local host.

Can you help me understand what I need to check for ?

My devices default to dark mode. However, even when I request light mode on the site, it doesn’t work—it remains in dark mode. This indicates there is an issue with how the dark/light mode works on the site. You’re using gatsby which is high on the list of frameworks I steer well away.

I suggest you test productions builds locally. After running dev mode, remove any output/build directory and run the build command for the project (e.g. npm run build.) If you have a package like serve installed globally test the build using serve -s <build-directory>. If you dont’ run npx serve -s <build-directory>. Test and observe the behaviour of the site.

Failing that, find a general development forum and post a question there as this isn’t an issue with Netlify.