Skip to content

Commit

Permalink
Create __dynamic_light-dark_detection.tid
Browse files Browse the repository at this point in the history
  • Loading branch information
linonetwo committed Nov 24, 2024
1 parent 7d2b56e commit eb971ac
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tiddlers/__dynamic_light-dark_detection.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
caption: Dynamically detect browser or OS setting
code-body: yes
tags: $:/tags/DarkLightChangeActions
title: _/dynamic/light-dark/detection

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

0 comments on commit eb971ac

Please sign in to comment.