Drafts Theme Toggle

Updated 07172022-112234


Description

Toggle between light and dark themes.

JS

// Toggle between light and dark themes
if (app.themeMode == "dark") {
  app.themeMode = "light";
}
else {
  app.themeMode = "dark";
}

Install

drafts://action?data=%7B%22uuid%22:%22F6FDBB1E-B245-4404-9824-D68DC2953483%22,%22steps%22:%5B%7B%22platforms%22:3,%22data%22:%7B%22script%22:%22%5C/%5C/%20Toggle%20between%20light%20and%20dark%20themes%5Cnif%20(app.themeMode%20%3D%3D%20%5C%22dark%5C%22)%20%7B%5Cn%20%20app.themeMode%20%3D%20%5C%22light%5C%22;%5Cn%7D%5Cnelse%20%7B%5Cn%20%20app.themeMode%20%3D%20%5C%22dark%5C%22;%5Cn%7D%22,%22allowAsync%22:%22false%22%7D,%22type%22:%22script%22,%22isEnabled%22:true,%22uuid%22:%22618FF903-AD8D-41C1-85B3-EC55BC6B026F%22%7D%5D,%22backingPlatforms%22:3,%22shortName%22:%22%22,%22shouldConfirm%22:false,%22disposition%22:0,%22keyCommand%22:%7B%22optionKey%22:false,%22input%22:%22L%22,%22controlKey%22:true,%22commandKey%22:false,%22type%22:%22action%22,%22discoverabilityTitle%22:%22Toggle%20Theme%22,%22shiftKey%22:true%7D,%22logLevel%22:1,%22groupDisposition%22:0,%22notificationType%22:2,%22tintColor%22:%22gray%22,%22actionDescription%22:%22Toggle%20between%20light%20and%20dark%20themes.%22,%22keyUseIcon%22:true,%22icon%22:%22681-weather-sunny%22,%22visibility%22:480,%22backingIsSeparator%22:false,%22groupUUID%22:%22DA97D16B-7D2D-4E29-8B87-AED9B9EF72A2%22,%22assignTags%22:%5B%5D,%22name%22:%22Toggle%20Theme%22%7D