fix: 解决menu-background-color变量被firefox的userChrome.css覆盖问题

This commit is contained in:
AnNingUI
2025-08-15 22:54:49 +08:00
parent 3b506fe8a8
commit 8ea85d78ee
5 changed files with 220 additions and 217 deletions

View File

@@ -114,7 +114,7 @@
</template>
<script>
import { ref, computed, watch, onMounted } from 'vue'
import { computed, onMounted, ref, watch } from 'vue'
import { useIsMobile } from '~/utils/screen'
export default {
@@ -312,7 +312,7 @@ export default {
border: none;
outline: none;
margin-left: 5px;
background-color: var(--menu-background-color);
background-color: var(--app-menu-background-color);
color: var(--text-color);
}
@@ -352,7 +352,7 @@ export default {
left: 0;
right: 0;
bottom: 0;
background-color: var(--menu-background-color);
background-color: var(--app-menu-background-color);
z-index: 1300;
display: flex;
flex-direction: column;

View File

@@ -18,7 +18,7 @@
</template>
<script>
import { ref, onMounted, onBeforeUnmount } from 'vue'
import { onBeforeUnmount, onMounted, ref } from 'vue'
export default {
name: 'DropdownMenu',
props: {
@@ -61,6 +61,7 @@ export default {
position: relative;
display: inline-block;
}
.dropdown-trigger {
cursor: pointer;
display: inline-flex;
@@ -71,7 +72,7 @@ export default {
position: absolute;
top: 100%;
right: 0;
background-color: var(--menu-background-color);
background-color: var(--app-menu-background-color);
border: 1px solid var(--normal-border-color);
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
border-radius: 8px;
@@ -84,6 +85,7 @@ export default {
white-space: nowrap;
cursor: pointer;
}
.dropdown-item:hover {
background-color: var(--menu-selected-background-color);
}

View File

@@ -115,9 +115,9 @@
</div>
</div>
</div>
<!-- 解决动态样式的水合错误 -->
<ClientOnly v-if='!isMobile'>
<ClientOnly v-if="!isMobile">
<div class="menu-footer">
<div class="menu-footer-btn" @click="cycleTheme">
<i :class="iconClass"></i>
@@ -129,11 +129,11 @@
</template>
<script setup>
import { ref, computed, watch, onMounted } from 'vue'
import { themeState, cycleTheme, ThemeMode } from '~/utils/theme'
import { computed, onMounted, ref, watch } from 'vue'
import { authState } from '~/utils/auth'
import { fetchUnreadCount, notificationState } from '~/utils/notification'
import { useIsMobile } from '~/utils/screen'
import { cycleTheme, ThemeMode, themeState } from '~/utils/theme'
const isMobile = useIsMobile()
@@ -232,7 +232,7 @@ const gotoTag = (t) => {
position: sticky;
top: var(--header-height);
width: 220px;
background-color: var(--menu-background-color);
background-color: var(--app-menu-background-color);
height: calc(100vh - 20px - var(--header-height));
border-right: 1px solid var(--menu-border-color);
display: flex;

View File

@@ -37,10 +37,10 @@
</template>
<script setup>
import { useIsMobile } from '~/utils/screen'
import { ref, watch } from 'vue'
import Dropdown from '~/components/Dropdown.vue'
import { stripMarkdown } from '~/utils/markdown'
import { ref, watch } from 'vue'
import { useIsMobile } from '~/utils/screen'
const config = useRuntimeConfig()
const API_BASE_URL = config.public.apiBaseUrl
@@ -135,7 +135,7 @@ defineExpose({
}
.text-input {
background-color: var(--menu-background-color);
background-color: var(--app-menu-background-color);
color: var(--text-color);
border: none;
outline: none;