mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-11-09 02:20:36 +00:00
Use localStorage for the selected theme in the docs
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
|
||||
// setTheme(<link />, 'light' / 'dark')
|
||||
function setTheme(theme) {
|
||||
document.cookie = 'css=' + theme + '; path=/';
|
||||
localStorage.setItem('theme', theme);
|
||||
return style.href = 'css/docs.' + theme + '.css';
|
||||
}
|
||||
|
||||
@@ -24,9 +24,7 @@
|
||||
});
|
||||
}
|
||||
|
||||
setTheme(document.cookie
|
||||
.split(';')[0]
|
||||
.split('=')[1] || 'light');
|
||||
setTheme(localStorage.getItem('theme') || 'light');
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
setThemeOnClick('light', document.getElementById('themeLight'));
|
||||
|
||||
Reference in New Issue
Block a user