I recently completed an Electron project and decided to incorporate dark mode support into it. However, for some reason, the dark mode feature is not functioning properly.
Below you will find the dark.css
styling that I have included in every page:
@media (prefers-color-scheme: dark) {
body, .full-screen, #code {
transition-duration: 500ms;
background: #444 !important;
color: #e4e4e4 !important;
}
.title-bar {
background: rgb(58, 58, 58) !important;
}
}
I am puzzled as to why this issue is occurring. I have read that I can utilize systemPreferences.isDarkMode()
, but that seems to only work for the main process, whereas I would like the dark mode to be applied in the frontend and automatically update.
Any assistance with resolving this matter would be greatly appreciated.