mirror of
https://github.com/DirectoryLister/DirectoryLister.git
synced 2025-08-28 08:10:51 +02:00
Set default theme based on users system theme
This commit is contained in:
@@ -25,7 +25,7 @@ const app = new Vue({
|
||||
},
|
||||
},
|
||||
created: function () {
|
||||
this.theme = localStorage.getItem('theme') || 'light';
|
||||
this.theme = localStorage.theme || (window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark');
|
||||
},
|
||||
mounted: function() {
|
||||
window.addEventListener('keyup', e => e.key === '/' && this.$refs.searchInput.focus());
|
||||
|
Reference in New Issue
Block a user