File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -7,3 +7,17 @@ WebFont.load({
7
7
] ,
8
8
} ,
9
9
} ) ;
10
+
11
+ const light : HTMLLinkElement = document . querySelector ( '#light' ) ;
12
+ const dark : HTMLLinkElement = document . querySelector ( '#dark' ) ;
13
+ const body : HTMLElement = document . body ;
14
+
15
+ dark . onclick = e => {
16
+ body . classList . remove ( 'light' ) ;
17
+ body . classList . add ( 'dark' ) ;
18
+ } ;
19
+
20
+ light . onclick = e => {
21
+ body . classList . remove ( 'dark' ) ;
22
+ body . classList . add ( 'light' ) ;
23
+ } ;
Original file line number Diff line number Diff line change 23
23
< a href ="# "> Theme</ a >
24
24
< ul class ="dropdown ">
25
25
< li class ="dropdown-item ">
26
- < a id ="# light " href ="# ">
26
+ < a id ="light " href ="# ">
27
27
Light
28
28
</ a >
29
29
</ li >
30
30
< li class ="dropdown-item ">
31
- < a id ="# dark " href ="# ">
31
+ < a id ="dark " href ="# ">
32
32
Dark
33
33
</ a >
34
34
</ li >
You can’t perform that action at this time.
0 commit comments