danieltslz commited on
Commit
f98b94e
·
verified ·
1 Parent(s): a3692b7

Show current theme icon

Browse files
Files changed (1) hide show
  1. theme.js +11 -4
theme.js CHANGED
@@ -31,8 +31,8 @@
31
  root.dataset.theme = night ? "night" : "day";
32
 
33
  button.textContent = night
34
- ? "☀️ Day"
35
- : "🌙 Night";
36
 
37
  button.setAttribute(
38
  "aria-pressed",
@@ -42,8 +42,15 @@
42
  button.setAttribute(
43
  "aria-label",
44
  night
45
- ? "Switch to day mode"
46
- : "Switch to night mode",
 
 
 
 
 
 
 
47
  );
48
  }
49
 
 
31
  root.dataset.theme = night ? "night" : "day";
32
 
33
  button.textContent = night
34
+ ? "🌙"
35
+ : "☀️";
36
 
37
  button.setAttribute(
38
  "aria-pressed",
 
42
  button.setAttribute(
43
  "aria-label",
44
  night
45
+ ? "Current theme: dark. Switch to light theme"
46
+ : "Current theme: light. Switch to dark theme",
47
+ );
48
+
49
+ button.setAttribute(
50
+ "title",
51
+ night
52
+ ? "Switch to light theme"
53
+ : "Switch to dark theme",
54
  );
55
  }
56