File tree Expand file tree Collapse file tree 2 files changed +21
-3
lines changed
Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -29,11 +29,29 @@ export default {
2929 },
3030
3131 created () {
32- this .setDarkMode ();
32+ this .setEditorTheme ();
3333 },
3434
3535 methods: {
36- setDarkMode () {
36+ setEditorTheme () {
37+ const selectedNovaTheme = localStorage .novaTheme ;
38+
39+ if (typeof selectedNovaTheme !== ' undefined' ) {
40+ if (selectedNovaTheme == ' system' ) {
41+ this .setSystemMode ();
42+ } else if (selectedNovaTheme == ' dark' ) {
43+ this .field .options .init .skin = ' oxide-dark' ;
44+ this .field .options .init .content_css = ' dark' ;
45+ } else {
46+ this .field .options .init .skin = ' oxide' ;
47+ this .field .options .init .content_css = ' default' ;
48+ }
49+ } else {
50+ this .setSystemMode ();
51+ }
52+ },
53+
54+ setSystemMode () {
3755 this .field .options .init .skin =
3856 window .matchMedia (" (prefers-color-scheme: dark)" ).matches ||
3957 document .querySelector (" html" ).classList .contains (" dark" )
You can’t perform that action at this time.
0 commit comments