node-red-contrib-themes/midnight-red
- Your IOTstack is running.
Open a shell into the nodered container and install the package:
$ docker exec -it nodered bash
# cd /data
# npm install @node-red-contrib-themes/midnight-red /data
# exit
$
Switch to the Node-Red data directory:
$ cd ~/IOTstack/volumes/nodered/data
Make a backup of your settings.js:
$ sudo cp settings.js settings.js.bak
Open settings.js in your favourite text editor. My first encounter with Unix was circa 1984 so I use VI out of very-deeply-ingrained habit 🤯:
$ sudo vi settings.js
Search for this (it is at the end of the file):
// Customising the editor
editorTheme: {
projects: {
// To enable the Projects feature, set this value to true
enabled: false
}
}
Make it look like this:
// Customising the editor
editorTheme: {
projects: {
// To enable the Projects feature, set this value to true
enabled: false
},
page: {
css: "/data/node_modules/@node-red-contrib-themes/midnight-red/theme.css"
}
}
Before you save your work, double-check:
- That you have added a comma after the "}" in the "projects" grouping.
- That you replaced
<HOME>/.node-red
(from the instructions) with/data
Save your work.
Restart Node-Red:
$ cd ~/IOTstack
$ docker-compose restart nodered
Check the Node-Red log for signs of problems (you are mainly looking for complaints about syntax errors in your settings.js):
$ docker logs nodered
If all seems well, reload your Node-Red browser page. Enjoy!
Fixed! The changes are quite subtle so I'll point them out:
cd /data
after opening a shell in the container./data
onto the end of thenpm install
command./usr/src/node-red
to/data
).If you want to force a "clean slate" before you re-apply the recipe, you can simulate the effect of a container update or new version of the nodered image, like this:
After you follow the revised recipe, you can use the same approach to confirm that the midnight-red theme will persist across container updates.
Thanks for pointing this out. I had not noticed that the change wasn't persistent because I reverted to the default theme to do some screen-captures and then never re-implemented midnight-red.