Renamed variable to make more sense

This commit is contained in:
2022-03-04 18:24:53 +01:00
parent fc2b139653
commit b9f39e690d

View File

@@ -8,7 +8,7 @@
export default { export default {
data() { data() {
return { return {
darkmode: this.supported() darkmode: this.systemDarkModeEnabled()
}; };
}, },
methods: { methods: {
@@ -16,7 +16,7 @@ export default {
this.darkmode = !this.darkmode; this.darkmode = !this.darkmode;
document.body.className = this.darkmode ? "dark" : "light"; document.body.className = this.darkmode ? "dark" : "light";
}, },
supported() { systemDarkModeEnabled() {
const computedStyle = window.getComputedStyle(document.body); const computedStyle = window.getComputedStyle(document.body);
if (computedStyle["colorScheme"] != null) { if (computedStyle["colorScheme"] != null) {
return computedStyle.colorScheme.includes("dark"); return computedStyle.colorScheme.includes("dark");