Skip to content

Commit

Permalink
fix: fix the dark mode display & switch problem
Browse files Browse the repository at this point in the history
  • Loading branch information
7086cmd committed Oct 23, 2023
1 parent 18d0dfe commit da33739
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
10 changes: 4 additions & 6 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function logout() {
</script>

<template>
<ElContainer @contextmenu.prevent class="bg-slate-50 dark:bg-slate-700">
<ElContainer @contextmenu.prevent class="bg-slate-50 dark:bg-slate-800">
<ElHeader>
<ElRow class="pt-4 px-4">
<ElCol :span="16">
Expand Down Expand Up @@ -65,19 +65,17 @@ function logout() {
</ElHeader>
<ElContainer style="width: 100%; height: 100%">
<UserNav style="height: 100%" v-if="userStore.isLogin" />
<RouterView v-if="userStore.isLogin" class="bg-white dark:bg-black view" />
<RouterView v-if="userStore.isLogin" class="bg-white dark:bg-slate-900 view" />
<RouterView v-else class="bg-slate-50 dark:bg-slate-900 view" />
</ElContainer>
<ElFooter class="footer">
<p class="text-center">&copy; 2018-2023 镇海中学义管会技术部 MIT License</p>
<ElFooter class="footer bg-gray-100 text-gray-400 dark:text-gray-300 dark:bg-gray-800">
<p class="text-center">&copy; 2018-2023 镇海中学义管会技术部 MIT Licensed</p>
</ElFooter>
</ElContainer>
</template>

<style scoped>
.footer {
background-color: #f5f5f5;
color: #666;
font-size: 0.8rem;
position: absolute;
width: 100%;
Expand Down
4 changes: 2 additions & 2 deletions src/assets/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@

body {
min-height: 100vh;
color: var(--color-text);
background: var(--color-background);
/* color: var(--color-text); */
/* background: var(--color-background); */
/* background-color: #fefefe; */
transition:
color 0.5s,
Expand Down
3 changes: 1 addition & 2 deletions src/views/user/UserNav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ function routeTo(page: string) {
</script>

<template>
<div class="px-2 bg-slate-50 dark:bg-slate-700 pl-3 menu">
<div class="px-2 bg-slate-50 dark:bg-slate-800 pl-3 menu">
<div v-for="nav in navs" :key="nav.path">
<div class="py-1" v-if="nav.show">
<ElTooltip
Expand Down Expand Up @@ -226,7 +226,6 @@ function routeTo(page: string) {
</ElPopover>
<br />
<ElButton
disabled
:icon="dark ? Moon : Sunny"
size="large"
text
Expand Down
1 change: 1 addition & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ export default {
extend: {},
},
plugins: [],
darkMode: 'class'
}

0 comments on commit da33739

Please sign in to comment.