diff --git a/src/assets/main.css b/src/assets/main.css index 66a7784..8d558d3 100644 --- a/src/assets/main.css +++ b/src/assets/main.css @@ -73,3 +73,10 @@ main { font-size: 16px !important; } +code[class*='language-'], +pre[class*='language-'], +.content code, +.content pre { + color: #000000; +} + diff --git a/src/components/HeaderNav.vue b/src/components/HeaderNav.vue index c510a09..72d1c21 100644 --- a/src/components/HeaderNav.vue +++ b/src/components/HeaderNav.vue @@ -58,7 +58,7 @@ const headerLinksHoverColor = ref(headerLinksHoverColorSetting) const headerLinksBackgroundColor = ref(headerLinksBackgroundColorSetting) const clearActiveTab = () => { - const activeLinks = document.querySelectorAll('.router-link') + const activeLinks = document.querySelectorAll('.router-link') for (const active of activeLinks) { // Skip login and logoff buttons if (active.id && active.id !== 'login' && active.id !== 'logoff') { @@ -68,7 +68,7 @@ const clearActiveTab = () => { } } -const setActive = (target) => { +const setActive = (target: HTMLElement | null) => { if (target) { clearActiveTab() target.style.backgroundColor = headerLinksBackgroundColor.value @@ -102,11 +102,11 @@ onMounted(async () => { }) watchEffect(() => { - const path = route.name - if (path && route.params && !route.params.id) { - setActive(document.getElementById('header-nav-' + path)) + const routeName = typeof route.name === 'string' ? route.name : null + if (routeName && route.params && !route.params.id) { + setActive(document.getElementById(`header-nav-${routeName}`)) } else { - if (path == 'message-docs') { + if (routeName === 'message-docs') { clearActiveTab() } else { setActive(document.getElementById('header-nav-tags'))