Light / Dark Palette Switching - One more time ;)

Hi foks,
I did just push an attempt to get the light / dark palettes switching into the TW core.

The preview can be found at: https://tiddlywiki5-gajbl6dhb-jermolene.vercel.app/
The PR is at GH: add browser dark/light theme detection by pmario · Pull Request #7830 · Jermolene/TiddlyWiki5 · GitHub

The configuration is in ControlPanel → Appearence → Palette, where it belongs.

  • By default the new configuration can “Enable Light/Dark Mode Handling” to change the setting manually
  • There is a definition for a “Light Palette” and a “Dark Palette”
  • If the configuration should be switched automatically, according to the browser “appearence” setting we need an action-tiddler tagged: $:/tags/DarkLightChangeActions
    • So several plugins can add new actions if needed
  • If the action-tiddler is removed, auto-switching is gone and the menue is for manual switching.

These changes are compatible with my PaletteManager preview function and the TiddlyTools PaletteManager (not shown in the screencast below)

light-dark-mode

have fun!
mario

4 Likes