-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
26 lines (22 loc) · 938 Bytes
/
Copy pathscript.js
File metadata and controls
26 lines (22 loc) · 938 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
var rootStyles = document.querySelector(":root").style;
var theme = "light";
function toggleDarkTheme() {
if (theme === "light") {
theme = "dark";
rootStyles.setProperty("--primary-color", "#ffffff");
rootStyles.setProperty("--secondary-color", "#000000");
rootStyles.setProperty("--bg-gradient-color-one", "#3c5502");
rootStyles.setProperty("--bg-gradient-color-two", "#114618");
rootStyles.setProperty("--link-color", "#9944ee");
}
}
function toggleLightTheme() {
if (theme === "dark") {
theme = "light";
rootStyles.setProperty("--primary-color", "#000000");
rootStyles.setProperty("--secondary-color", "#ffffff");
rootStyles.setProperty("--bg-gradient-color-one", "#d4fc79");
rootStyles.setProperty("--bg-gradient-color-two", "#96e6a1");
rootStyles.setProperty("--link-color", "#663399");
}
}