mermaid support
This commit is contained in:
parent
0c9211f27b
commit
e7eb6932e2
19 changed files with 125 additions and 124 deletions
|
@ -1,21 +0,0 @@
|
|||
window.addEventListener('DOMContentLoaded', function () {
|
||||
const light = '🌝', dark = '🌚';
|
||||
const LIGHT = 'light', DARK = 'dark';
|
||||
const themeSwitcher = document.getElementById('theme-switcher');
|
||||
|
||||
themeSwitcher.innerHTML = localStorage.theme === LIGHT ? light : dark;
|
||||
|
||||
themeSwitcher.addEventListener('click', function () {
|
||||
const currentTheme = localStorage.theme,
|
||||
newTheme = currentTheme === LIGHT ? DARK : LIGHT,
|
||||
{ classList } = document.querySelector('html'),
|
||||
text = newTheme === LIGHT ? light : dark;
|
||||
classList.remove(currentTheme);
|
||||
classList.add(newTheme);
|
||||
localStorage.theme = newTheme;
|
||||
themeSwitcher.innerHTML = text;
|
||||
});
|
||||
|
||||
|
||||
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue