Skip to content

Commit 1b2d899

Browse files
committed
SHIT ===> GOLD (C) whatthecommit.com
1 parent 47d72cd commit 1b2d899

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

css-theme/src/app.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,17 @@ WebFont.load({
77
],
88
},
99
});
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+
};

css-theme/src/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
<a href="#">Theme</a>
2424
<ul class="dropdown">
2525
<li class="dropdown-item">
26-
<a id="#light" href="#">
26+
<a id="light" href="#">
2727
Light
2828
</a>
2929
</li>
3030
<li class="dropdown-item">
31-
<a id="#dark" href="#">
31+
<a id="dark" href="#">
3232
Dark
3333
</a>
3434
</li>

0 commit comments

Comments
 (0)