Skip to content

Commit f54ba23

Browse files
authored
Merge pull request #66 from new-sankaku/claude/fix-dark-mode-scroll-bg-WcPf3
Fix white background showing on scroll in dark mode
2 parents c3e2f9c + db3457e commit f54ba23

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed

css/common.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
@import url('root.css');
22

3+
html,body {
4+
background-color: var(--color-base);
5+
}
6+
37
body {
48
display: flex;
59
flex-direction: column;

css/root.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@
130130
}
131131

132132
:root {
133-
133+
--color-base: #212121;
134+
--background-color-A: #212121;
135+
134136
--nav-height: calc(100vh - 96vh);
135137
--main-height: calc(100vh - 4vh);
136138
--left_area-height: calc(100vh - 5vh);

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE html>
2-
<html lang="en">
2+
<html lang="en" class="dark-mode">
33

44
<head>
55
<title>Manga Editor Desu! Pro Edition: The Premier Standalone Manga Editing Platform</title>

js/ui/util/mode-change.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,12 @@ function toggleMode() {
140140
const isDarkMode=document.body.classList.toggle('dark-mode');
141141
const logo=$('navbar-logo');
142142

143+
document.documentElement.classList.remove('light-mode');
144+
document.documentElement.classList.add('dark-mode');
143145
document.body.classList.remove('light-mode');
144146
document.body.classList.add('dark-mode');
147+
document.documentElement.classList.remove('light-mode');
148+
document.documentElement.classList.add('dark-mode');
145149
localStorage.setItem('mode','dark-mode');
146150
logo.src='02_images_svg/Logo/black_mode_logo.webp';
147151

@@ -157,7 +161,9 @@ $('mode-toggle').addEventListener('change',toggleMode);
157161
function initializeMode() {
158162
// const mode = localStorage.getItem('mode') || 'dark-mode';
159163
const mode='dark-mode';
164+
document.documentElement.classList.add(mode);
160165
document.body.classList.add(mode);
166+
document.documentElement.classList.add(mode);
161167
const logo=$('navbar-logo');
162168
if (mode==='dark-mode') {
163169
$('mode-toggle').checked=true;

0 commit comments

Comments
 (0)