Skip to content

Commit

Permalink
[dark] change message by theme
Browse files Browse the repository at this point in the history
  • Loading branch information
alireza0 committed Feb 20, 2024
1 parent 035a1a7 commit 6cdeb7e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions web/assets/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -1038,6 1038,12 @@ li.ant-select-dropdown-menu-item:empty:after {
color: rgba(255, 255, 255, 0.25);
}

.dark .ant-message-notice-content {
background-color: #222d42;
border: 1px solid #2c3950;
color: rgba(255, 255, 255, 0.65);
}

.ant-input-number-handler-wrap {
border-radius: 0;
}
Expand Down
1 change: 1 addition & 0 deletions web/html/common/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 28,5 @@
</style>
<title>{{ .host }}-{{ i18n .title}}</title>
</head>
<div id="message"></div>
{{end}}
5 changes: 5 additions & 0 deletions web/html/xui/component/themeSwitch.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 19,7 @@
toggleTheme() {
this.isDarkTheme = !this.isDarkTheme;
localStorage.setItem('dark-mode', this.isDarkTheme);
document.getElementById('message').className = themeSwitcher.currentTheme;
},
};
}
Expand All @@ -29,6 30,10 @@
props: [],
template: `{{template "component/themeSwitchTemplate"}}`,
data: () => ({ themeSwitcher }),
mounted() {
this.$message.config({getContainer: () => document.getElementById('message')});
document.getElementById('message').className = themeSwitcher.currentTheme;
}
});
</script>
{{end}}

0 comments on commit 6cdeb7e

Please sign in to comment.