mirror of
https://github.com/notion-enhancer/notion-enhancer.git
synced 2025-04-07 05:59:02 +00:00
17 lines
466 B
JavaScript
17 lines
466 B
JavaScript
/*
|
|
* notion-enhancer core: theming
|
|
* (c) 2021 dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/)
|
|
* (https://notion-enhancer.github.io/) under the MIT license
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
import { web } from '../../api/_.mjs';
|
|
|
|
const $root = document.querySelector(':root');
|
|
web.addDocumentObserver((mutation) => {
|
|
if (mutation.target === document.body) {
|
|
$root.classList[document.body.classList.contains('dark') ? 'add' : 'remove']('dark');
|
|
}
|
|
});
|