[INTRO] Palette Switcher Plugin (manual and at startup)

The Palette Switcher Plugin

palette-switcher-startup-04

allows you to easily select between dark and light modes

Demo

Screenshots

Settings

In the ControlPanelSettings → WikiLabs → Palette Switcher tab can be used to change the default setting.

  1. The standard switcher buttons are the same as in the Appearence → Palette tab - Light Palette is currently selected
  2. Dark Palette can be selected using button 2
  3. Enable Automatic Dark/Light Mode Detection - on wiki startup
  4. Show all possible palettes in the palette drop-down

Setup The Startup Actions

Add 3)
By default “Enable Automatic Dark/Light Mode Detection” is disabled, so the manual mode is active

If you want to activate autmatic mode selection, you need a TW startup action.
Detailed Information can be found in the plugin readme which can be opened by the link seen in the screenshot. (5)

  • Once this tiddler is in place, your wiki should change between light and dark mode depending on the users browser or OS setting at startup

  • To adjust dark/light mode dynamically the Palette Watch plugin is needed. This plugin needs a browser restart.

Add 6)
You need to scroll down to Detect Light / Dark Setting on Startup, there is a button which creates the needed tiddler. (7)

title: _/startup/light-dark/detection
caption: {{$:/language/ControlPanel/Palette/Config/Detection/Caption}}
code-body: yes
tags: $:/tags/StartupAction/Browser

<$reveal type="match" stateTitle="$:/config/palette/enable-light-dark-detection" text="yes">
	<$let default={{{ [{$:/info/darkmode}match[yes]then[$:/config/palette/default-dark]else[$:/config/palette/default-light]] }}}>
		<$action-setfield $tiddler="$:/palette" text={{{ [<default>get[text]] }}}/>
	</$let>
</$reveal>

WikiLabs Suite

The WikiLabs Main Page gives an overview about all editions, plugins and themes.

There is an Introduction Video how to make the WikiLabs Plugin Library available in your own wikis, accessible from the ControlPanel → Plugins → Get More Plugins dialogue.

Show Screenshot

Code

About Open Source

Most open source software is free of charge and that’s a good thing! But that does not mean, that there are no costs for someone to create, support and maintain it.

So if you use it: Support it!

Have fun!
Mario

2 Likes

I wait a few days so it is auto-crawled by CPL, and I install it just now, it works great, thank you!

Just hope this plugin and [UPDATE] Palette Manager Edition / Plugin - New Previews, All Core Palettes Fixed can have Chinese translation, after feat: i18n framework based on extracting translations from plugin's /languages/ to /language/ by linonetwo · Pull Request #8435 · TiddlyWiki/TiddlyWiki5 · GitHub