summaryrefslogblamecommitdiff
path: root/js/toggleTheme.ts
blob: fd15dae289e8fb99c6a410badd4736eaeed6fca3 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

















                                                              
/// <reference path="setTheme.ts" />

function toggleTheme() {
	let theme = localStorage.getItem("theme");

	if (theme == "light") {
		theme = "dark";
	} else if (theme == "dark") {
		theme = "light";
	} else {
		console.log!("invalid theme `" + theme + "`");

		// Use default:
		theme = "dark";
	}

	setTheme(theme);
}