Skip to content

Commit 0499cf8

Browse files
RKBoss6Copilot
andauthored
Update js/index.js
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 36db746 commit 0499cf8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

js/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,9 @@ function iframeSetup(options) {
320320
// Style custom apps for dark mode
321321
const iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
322322
if (iframeDoc && iframeDoc.body) {
323-
const bgColor = window.matchMedia('(prefers-color-scheme: dark)').matches ? '#2c2c2c' : '#ffffff';
324-
const textColor = window.matchMedia('(prefers-color-scheme: dark)').matches ? '#FFFFFF' : '#000000';
323+
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
324+
const bgColor = prefersDark ? '#2c2c2c' : '#ffffff';
325+
const textColor = prefersDark ? '#FFFFFF' : '#000000';
325326
iframeDoc.body.style.backgroundColor = bgColor;
326327
iframeDoc.body.style.color = textColor;
327328
}

0 commit comments

Comments
 (0)