summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2021-02-06 18:37:32 +0900
committersyuilo <syuilotan@yahoo.co.jp>2021-02-06 18:37:32 +0900
commit9b3458fba0c6406600c48ec55a0318c00f908770 (patch)
treebf9ce4ff2a236c942e798bc21a8770b7a977e2a7 /src/client
parentImprove theme editor (diff)
downloadmisskey-9b3458fba0c6406600c48ec55a0318c00f908770.tar.gz
misskey-9b3458fba0c6406600c48ec55a0318c00f908770.tar.bz2
misskey-9b3458fba0c6406600c48ec55a0318c00f908770.zip
Resolve #7096
Diffstat (limited to 'src/client')
-rw-r--r--src/client/pages/theme-editor.vue13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/client/pages/theme-editor.vue b/src/client/pages/theme-editor.vue
index d2cd81d867..2bf0a4383e 100644
--- a/src/client/pages/theme-editor.vue
+++ b/src/client/pages/theme-editor.vue
@@ -62,7 +62,7 @@ import FormButton from '@/components/form/button.vue';
import FormTextarea from '@/components/form/textarea.vue';
import FormGroup from '@/components/form/group.vue';
-import { Theme, applyTheme, validateTheme } from '@/scripts/theme';
+import { Theme, applyTheme, validateTheme, darkTheme, lightTheme } from '@/scripts/theme';
import { host } from '@/config';
import * as os from '@/os';
import { ColdDeviceStorage } from '@/store';
@@ -84,7 +84,7 @@ export default defineComponent({
},
theme: {
base: 'light',
- props: {}
+ props: lightTheme.props
} as Theme,
codeEnabled: false,
themeCode: null,
@@ -123,7 +123,6 @@ export default defineComponent({
created() {
this.$watch('theme', this.apply, { deep: true });
-
window.addEventListener('beforeunload', this.beforeunload);
},
@@ -159,6 +158,14 @@ export default defineComponent({
},
setBgColor(color) {
+ if (this.theme.base != color.kind) {
+ const base = color.kind === 'dark' ? darkTheme : lightTheme;
+ for (const prop of Object.keys(base.props)) {
+ if (prop === 'accent') continue;
+ if (prop === 'fg') continue;
+ this.theme.props[prop] = base.props[prop];
+ }
+ }
this.theme.base = color.kind;
this.theme.props.bg = color.color;