Skip to content

Commit dddaed2

Browse files
committed
html要素にもダークモードクラスを適用してスクロール背景を修正
- :rootにデフォルトの--color-baseと--background-color-Aを設定 - html要素にも dark-mode/light-mode クラスを追加するよう修正 - index.htmlに初期クラスとしてdark-modeを追加
1 parent 9a04a66 commit dddaed2

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

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: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ const logo=$('navbar-logo');
142142

143143
document.body.classList.remove('light-mode');
144144
document.body.classList.add('dark-mode');
145+
document.documentElement.classList.remove('light-mode');
146+
document.documentElement.classList.add('dark-mode');
145147
localStorage.setItem('mode','dark-mode');
146148
logo.src='02_images_svg/Logo/black_mode_logo.webp';
147149

@@ -158,6 +160,7 @@ function initializeMode() {
158160
// const mode = localStorage.getItem('mode') || 'dark-mode';
159161
const mode='dark-mode';
160162
document.body.classList.add(mode);
163+
document.documentElement.classList.add(mode);
161164
const logo=$('navbar-logo');
162165
if (mode==='dark-mode') {
163166
$('mode-toggle').checked=true;

0 commit comments

Comments
 (0)