Skip to content
This repository has been archived by the owner on Nov 9, 2021. It is now read-only.

A simple toggle button #3

Answered by kookma
kookma asked this question in Q&A
Dec 14, 2020 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

@NicolasPetton - As you my follow my discussion with Saq on Google forum this is the most simple solution by now

<$vars
   lightPalette="$:/palettes/Vanilla"
   darkPalette="$:/palettes/SolarFlare"
>
<$button>Day/Night II
<$action-setfield $tiddler="$:/palette" text={{{[{$:/palette}match<lightPalette>then<darkPalette>else<lightPalette>]}}}/>
</$button>
</$vars>

You may read darkPalette and lightPalete from a config tiddler fields. This way you may let Notebook users to simply decide on their dark/light palettes instead of head coded them. I am not sure if it make sense to use other palettes or Notebook design restricts the palette to vanilla and beige.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@NicolasPetton
Comment options

Comment options

You must be logged in to vote
1 reply
@NicolasPetton
Comment options

Answer selected by kookma
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants