File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments