5656493676
* update macos dark mode docs for Electron v12 * pr review fixes * more pr review fixes * reorg paragraphs for better flow * Update docs/tutorial/dark-mode.md Co-authored-by: Erick Zhao <erick@hotmail.ca> * pr fixes Co-authored-by: Erick Zhao <erick@hotmail.ca>
9 lines
406 B
JavaScript
9 lines
406 B
JavaScript
document.getElementById('toggle-dark-mode').addEventListener('click', async () => {
|
|
const isDarkMode = await window.darkMode.toggle()
|
|
document.getElementById('theme-source').innerHTML = isDarkMode ? 'Dark' : 'Light'
|
|
})
|
|
|
|
document.getElementById('reset-to-system').addEventListener('click', async () => {
|
|
await window.darkMode.system()
|
|
document.getElementById('theme-source').innerHTML = 'System'
|
|
})
|