mounted() { const theme = localStorage.getItem('useDarkTheme'); if (theme) { if (theme == 'true') { setTimeout(() => { this.$vuetify.theme.dark = true; }, 0); } else { setTimeout(() => { this.$vuetify.theme.dark = false; }, 0); } } else if (window.matchMedia('(prefers-color-scheme: dark)').matches) { setTimeout(() => { this.$vuetify.theme.dark = true; }, 0); } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter