feat: adjust styles mainly nav

pull/672/head
Kia King Ishii 3 years ago
parent 4dde99619e
commit 53bf845463

@ -43,6 +43,9 @@ if (carbonOptions) {
<style> <style>
.VPCarbonAds { .VPCarbonAds {
display: flex;
justify-content: center;
align-items: center;
padding: 24px; padding: 24px;
border-radius: 8px; border-radius: 8px;
min-height: 240px; min-height: 240px;

@ -141,7 +141,7 @@ function onBlur() {
transition: opacity 0.25s, visibility 0.25s, transform 0.25s; transition: opacity 0.25s, visibility 0.25s, transform 0.25s;
} }
@media (min-width: 1280px) { @media (min-width: 960px) {
.menu { .menu {
top: calc(var(--vp-nav-height-desktop) / 2 + 20px); top: calc(var(--vp-nav-height-desktop) / 2 + 20px);
} }

@ -22,27 +22,22 @@ defineProps<{
<style scoped> <style scoped>
.VPMenu { .VPMenu {
border-radius: 8px; border-radius: 12px;
padding: 12px 0; padding: 12px;
min-width: 192px; min-width: 128px;
border: 1px solid transparent; border: 1px solid var(--vp-c-divider-light);
background: var(--vp-c-bg); background-color: var(--vp-c-bg);
box-shadow: var(--vp-shadow-3); box-shadow: var(--vp-shadow-3);
transition: background-color 0.5s; transition: background-color 0.5s;
} }
.dark .VPMenu { .dark .VPMenu {
background: var(--vp-c-bg); box-shadow: var(--vp-shadow-2);
box-shadow: var(--vp-shadow-1);
border: 1px solid var(--vp-c-divider-light);
}
.VPMenu :deep(.items) {
transition: border-color .5s;
} }
.VPMenu :deep(.group) { .VPMenu :deep(.group) {
padding: 0 0 12px; margin: 0 -12px;
padding: 0 12px 12px;
} }
.VPMenu :deep(.group + .group) { .VPMenu :deep(.group + .group) {

@ -15,16 +15,18 @@ defineProps<{
<style scoped> <style scoped>
.VPMenuLink { .VPMenuLink {
display: block; display: block;
padding: 0 16px; border-radius: 6px;
line-height: 28px; padding: 0 24px 0 12px;
font-size: 13px; line-height: 32px;
font-size: 14px;
font-weight: 500; font-weight: 500;
color: var(--vp-c-text-1); color: var(--vp-c-text-1);
white-space: nowrap; white-space: nowrap;
transition: color 0.25s; transition: background-color 0.25s, color 0.25s;
} }
.VPMenuLink:hover { .VPMenuLink:hover {
color: var(--vp-c-brand); color: var(--vp-c-brand);
background-color: var(--vp-c-bg-soft);
} }
</style> </style>

@ -1,6 +1,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { useData } from 'vitepress' import { useData } from 'vitepress'
import VPFlyout from './VPFlyout.vue' import VPFlyout from './VPFlyout.vue'
import VPMenuLink from './VPMenuLink.vue'
import VPSwitchAppearance from './VPSwitchAppearance.vue' import VPSwitchAppearance from './VPSwitchAppearance.vue'
import VPSocialLinks from './VPSocialLinks.vue' import VPSocialLinks from './VPSocialLinks.vue'
@ -10,21 +11,15 @@ const { site, theme } = useData()
<template> <template>
<VPFlyout class="VPNavBarExtra" label="extra navigation"> <VPFlyout class="VPNavBarExtra" label="extra navigation">
<div v-if="theme.localeLinks" class="group"> <div v-if="theme.localeLinks" class="group">
<div class="trans"> <p class="trans-title">{{ theme.localeLinks.text }}</p>
<p class="trans-title">
{{ theme.localeLinks.text }}
</p>
<ul class="trans-list"> <template v-for="locale in theme.localeLinks.items" :key="locale.link">
<li v-for="locale in theme.localeLinks.items" :key="locale.link" class="trans-item"> <VPMenuLink :item="locale" />
<a class="trans-link" :href="locale.link">{{ locale.text }}</a> </template>
</li>
</ul>
</div>
</div> </div>
<div v-if="site.appearance" class="group"> <div v-if="site.appearance" class="group">
<div class="item"> <div class="item appearance">
<p class="label">Appearance</p> <p class="label">Appearance</p>
<div class="appearance-action"> <div class="appearance-action">
<VPSwitchAppearance /> <VPSwitchAppearance />
@ -33,8 +28,8 @@ const { site, theme } = useData()
</div> </div>
<div v-if="theme.socialLinks" class="group"> <div v-if="theme.socialLinks" class="group">
<div class="item"> <div class="item social-links">
<VPSocialLinks class="social-links" :links="theme.socialLinks" /> <VPSocialLinks class="social-links-list" :links="theme.socialLinks" />
</div> </div>
</div> </div>
</VPFlyout> </VPFlyout>
@ -63,45 +58,29 @@ const { site, theme } = useData()
} }
.trans-title { .trans-title {
display: flex; padding: 0 24px 0 12px;
align-items: center; line-height: 32px;
font-size: 13px; font-size: 14px;
font-weight: 600; font-weight: 700;
color: var(--vp-c-text-1); color: var(--vp-c-text-1);
} }
.trans-icon { .item.appearance,
margin-right: 12px; .item.social-links {
width: 16px;
height: 16px;
fill: currentColor;
}
.trans-list {
padding: 2px 0 0 0;
}
.trans-link {
line-height: 28px;
font-size: 13px;
color: var(--vp-c-text-1);
transition: color 0.25s;
}
.trans-link:hover {
color: var(--vp-c-brand);
}
.item {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 0 24px;
}
.item.appearance {
min-width: 176px;
} }
.appearance-action { .appearance-action {
margin-right: -2px; margin-right: -2px;
} }
.social-links { .social-links-list {
margin: -4px -8px; margin: -4px -8px;
} }
</style> </style>

@ -1,7 +1,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { DefaultTheme, useData } from 'vitepress' import { useData } from 'vitepress'
import { isActive } from '../support/utils' import { isActive } from '../support/utils'
import { NavItemWithLink } from '../config' import { DefaultTheme } from '../config'
import VPLink from './VPLink.vue' import VPLink from './VPLink.vue'
defineProps<{ defineProps<{
@ -34,7 +34,7 @@ const { page } = useData()
align-items: center; align-items: center;
padding: 0 12px; padding: 0 12px;
line-height: var(--vp-nav-height-mobile); line-height: var(--vp-nav-height-mobile);
font-size: 13px; font-size: 14px;
font-weight: 500; font-weight: 500;
color: var(--vp-c-text-1); color: var(--vp-c-text-1);
transition: color 0.25s; transition: color 0.25s;

@ -19,6 +19,7 @@ const { hasSidebar } = useSidebar()
.VPNavBarTitle { .VPNavBarTitle {
flex-shrink: 0; flex-shrink: 0;
border-bottom: 1px solid transparent; border-bottom: 1px solid transparent;
transition: background-color 0.5s;
} }
@media (min-width: 960px) { @media (min-width: 960px) {

@ -1,16 +1,10 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from 'vue'
import { useData } from 'vitepress' import { useData } from 'vitepress'
import VPIconLanguages from './icons/VPIconLanguages.vue' import VPIconLanguages from './icons/VPIconLanguages.vue'
import VPFlyout from './VPFlyout.vue' import VPFlyout from './VPFlyout.vue'
import VPMenuLink from './VPMenuLink.vue'
const { theme } = useData() const { theme } = useData()
const isOpen = ref(false)
function toggle() {
isOpen.value = !isOpen.value
}
</script> </script>
<template> <template>
@ -19,16 +13,12 @@ function toggle() {
class="VPNavBarTranslations" class="VPNavBarTranslations"
:icon="VPIconLanguages" :icon="VPIconLanguages"
> >
<div class="container"> <div class="items">
<p class="title"> <p class="title">{{ theme.localeLinks.text }}</p>
{{ theme.localeLinks.text }}
</p>
<ul class="list"> <template v-for="locale in theme.localeLinks.items" :key="locale.link">
<li v-for="locale in theme.localeLinks.items" :key="locale.link" class="lang"> <VPMenuLink :item="locale" />
<a class="link" :href="locale.link">{{ locale.text }}</a> </template>
</li>
</ul>
</div> </div>
</VPFlyout> </VPFlyout>
</template> </template>
@ -45,30 +35,11 @@ function toggle() {
} }
} }
.container {
padding: 0 16px;
}
.title { .title {
display: flex; padding: 0 24px 0 12px;
align-items: center; line-height: 32px;
font-size: 13px; font-size: 14px;
font-weight: 600; font-weight: 700;
color: var(--vp-c-text-1); color: var(--vp-c-text-1);
} }
.lang {
padding: 4px 0 0 0;
}
.link {
line-height: 28px;
font-size: 13px;
color: var(--vp-c-text-1);
transition: color 0.25s;
}
.link:hover {
color: var(--vp-c-brand);
}
</style> </style>

@ -1,5 +1,5 @@
<script lang="ts" setup> <script lang="ts" setup>
import { DefaultTheme } from 'vitepress' import { DefaultTheme } from '../config'
import VPSocialLink from './VPSocialLink.vue' import VPSocialLink from './VPSocialLink.vue'
defineProps<{ defineProps<{

Loading…
Cancel
Save