import { remote } from 'electron' ; import { MajsoulPlus } from '../../../majsoul_plus' ; function changeTheme ( mode ) { const extraCss = document . querySelector ( '#extraCss' ) ; if ( mode === 'dark' ) { extraCss [ 'href' ] = './extra/darkMode/style.css' ; } } export default function darkMode ( userConfig ) { const { nativeTheme } = remote ; const setOSTheme = ( ) => { console . log ( nativeTheme . shouldUseDarkColors ) ; changeTheme ( nativeTheme . shouldUseDarkColors ? 'dark' : 'light' ) ; } ; nativeTheme . addListener ( 'updated' , ( ) => { setOSTheme ( ) ; } ) ; setOSTheme ( ) ; }