Skip to content

Commit 943ab37

Browse files
Copilotulysses4ever
andcommitted
Address code review feedback - improve accessibility and contrast
Co-authored-by: ulysses4ever <[email protected]>
1 parent 8264ba5 commit 943ab37

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

docs/assets/css/dark-mode.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ body.dark-mode code:not(.label, .function, .type, .class, .law) {
4040

4141
body.dark-mode pre > code {
4242
background-color: #0d0d0d;
43-
color: #00ff00;
43+
color: #90ee90;
4444
}
4545

4646
body.dark-mode .hintbox {
@@ -83,7 +83,7 @@ body.dark-mode .errata {
8383
position: fixed;
8484
top: 40px;
8585
right: 20px;
86-
z-index: 9999;
86+
z-index: 10000;
8787
background-color: #333;
8888
color: white;
8989
border: 2px solid #555;

docs/assets/js/dark-mode.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,13 @@
4141

4242
function updateButtonIcon(button) {
4343
if (document.body.classList.contains('dark-mode')) {
44-
button.innerHTML = '☀️';
44+
button.textContent = '☀️';
4545
button.setAttribute('title', 'Switch to light mode');
46+
button.setAttribute('aria-label', 'Switch to light mode');
4647
} else {
47-
button.innerHTML = '🌙';
48+
button.textContent = '🌙';
4849
button.setAttribute('title', 'Switch to dark mode');
50+
button.setAttribute('aria-label', 'Switch to dark mode');
4951
}
5052
}
5153

0 commit comments

Comments
 (0)