Nodejs.dev: Darkmode package replacement

Created on 24 Mar 2021  路  7Comments  路  Source: nodejs/nodejs.dev

Description

When we eventually update to Gatsby 3.x the current package we are using for our darkmode toggle breaks the site.
The code is not published on github but it is on npm.

We should ask @SMotaal to fix his package or replace it with one that works with Gatsby 3.x

Steps to reproduce

Update all gatsby packages to the latest versions
run the server locally

I had to comment out the controller to get to the next errors that are different.
See https://github.com/nodejs/nodejs.dev/pull/1166

Expected result

Load the site successfully

Actual result

Undefined error that stops the build

bug good first issue help wanted

All 7 comments

I can take a stab at this if thats cool?

Work and schools been crazy, but I just upgraded gatsby and am seeing the error now. It looks like this after trying to run npm start

Screen Shot 2021-03-28 at 9 00 14 PM

Gonna keep digging now

This one here called gatsby-plugin-dark-mode looks promising. Is there a reason it wasnt considered before @benhalverson ? If not I think ill try implementing it and see how it goes. It seems like the defacto gatsby dark mode standard

I don't remember the exact reasons, but it was probably for setting up the ability to remember the last selection of light vs dark mode. It also has a feature where if you long press the button it has a third state called auto that detects your OS preferred settings. This is all done with local storage. The three states are enabled, disabled and auto

Work and schools been crazy, but I just upgraded gatsby and am seeing the error now. It looks like this after trying to run npm start

This is one of the issues that is blocking my draft PR to upgrade Gatsby to 3.x https://github.com/nodejs/nodejs.dev/pull/1166#issuecomment-805540044

Oh it looks like the Gatsvy plugin supports all of that then. If there's nothing else the dark-mode-controller does for us can I switch it out?

Yep go for it.

Was this page helpful?
0 / 5 - 0 ratings