Skip to content

Commit

Permalink
0.1.35
Browse files Browse the repository at this point in the history
another attempt
  • Loading branch information
EDU-MDAnderson committed Sep 25, 2023
1 parent 414e7b4 commit 82a10ff
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ <h1>Matthew Anderson</h1>
</nav>
<main>
<h2>WDD 230: Web Frontend Development</h2>
<button id="darkModeToggle" onclick="toggleDarkMode()">Toggle Dark Mode</button>
<section class="card">
<h3>Learning Activities</h3>
<ul>
Expand Down
5 changes: 2 additions & 3 deletions scripts/darkmode.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// darkmode.js
function toggleDarkMode() {
const body = document.body;
body.classList.toggle('dark-mode');
const main = document.querySelector('main');
main.classList.toggle('dark-mode');
}
2 changes: 1 addition & 1 deletion styles/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ span {background-color: red}
hr {
border-top: .25rem solid #000000;
}
.dark-mode {
.dark-mode main {
background-color: #1f1f1f;
color: #ffffff;
}
Expand Down

0 comments on commit 82a10ff

Please sign in to comment.