chore: mobile font

This commit is contained in:
engigu
2026-04-17 21:09:12 +08:00
parent d16540b5cb
commit 98cf876ea0
4 changed files with 17 additions and 14 deletions
+6 -7
View File
@@ -242,10 +242,9 @@
@media (max-width: 639px) {
body {
font-size: 15.5px;
font-weight: 500;
line-height: 1.55;
letter-spacing: -0.01em;
/* 移动端使用 antialiased 以匹配高 DPI 渲染,开启字重补偿 */
/* 移动端使用 antialiased 以匹配高 DPI 渲染 */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
@@ -257,28 +256,28 @@
line-height: 1.3;
}
/* 正文与描述类文字同步加厚,使用标准字重 500 以匹配静态字体 */
/* 正文与描述类文字回归 400,依靠 15.5px 的字号保证清晰度 */
p,
span:not([class*="icon"]),
label,
[class*="description"],
[class*="muted"],
.text-muted-foreground {
font-weight: 500;
font-weight: 400;
line-height: 1.6;
}
/* 针对移动端小字进行字重补偿,使用标准字重 600 */
/* 针对移动端小字保持适度加重 */
.text-xs {
font-size: 12.5px;
font-weight: 600;
font-weight: 500;
line-height: 1.4;
letter-spacing: 0.01em;
}
.text-sm {
font-size: 14.5px;
font-weight: 500;
font-weight: 400;
line-height: 1.5;
}
+1 -1
View File
@@ -32,7 +32,7 @@ const { theme, setTheme } = useTheme()
</DropdownMenuItem>
<DropdownMenuItem @click="setTheme('system')" class="gap-2">
<Monitor class="h-4 w-4" />
<span>跟随系统</span>
<span>系统</span>
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
+8 -4
View File
@@ -134,7 +134,12 @@ onMounted(() => {
<nav class="flex-1 px-3 py-6 space-y-1 flex flex-col items-center overflow-y-auto">
<RouterLink v-for="item in navItems" :key="item.to" :to="item.to" custom v-slot="{ navigate }">
<Button variant="ghost"
:class="['justify-center gap-3 h-9 px-3 w-full max-w-[140px]', isItemActive(item) && 'bg-zinc-100 dark:bg-accent text-foreground dark:text-accent-foreground font-semibold shadow-sm']"
:class="[
'justify-center gap-3 h-10 px-3 w-full max-w-[140px] transition-all duration-200',
isItemActive(item)
? 'bg-secondary text-foreground font-bold'
: 'text-foreground hover:bg-secondary/50'
]"
@click="handleNavClick(navigate)">
<component :is="item.icon" class="h-4 w-4" />
{{ item.label }}
@@ -160,7 +165,7 @@ onMounted(() => {
<Menu class="h-5 w-5 text-muted-foreground" />
</Button>
<div class="flex flex-col sm:flex-row sm:items-baseline sm:gap-2 truncate">
<span class="text-sm text-muted-foreground truncate font-medium poem-sentence" :title="sentence">
<span class="text-sm text-muted-foreground truncate font-normal poem-sentence" :title="sentence">
<span class="hidden sm:inline">{{ sentence }}</span>
<span class="sm:hidden">{{ sentenceContent }}</span>
</span>
@@ -208,8 +213,7 @@ onMounted(() => {
@media (max-width: 639px) {
.poem-sentence {
font-weight: 400 !important;
opacity: 0.7 !important;
/* 与卡片标题保持一致,使用标准 font-medium 并取消淡化 */
letter-spacing: 0.01em;
}
}
+2 -2
View File
@@ -451,11 +451,11 @@ onUnmounted(() => {
<Card v-for="item in statItems" :key="item.key" class="cursor-pointer hover:bg-accent/50 transition-colors"
@click="navigateTo(item.route)">
<CardHeader class="flex flex-row items-center justify-between space-y-0 pb-2">
<CardTitle class="text-xs sm:text-sm font-medium">{{ item.label }}</CardTitle>
<CardTitle class="text-sm font-medium">{{ item.label }}</CardTitle>
<component :is="item.icon" class="h-4 w-4 text-muted-foreground" />
</CardHeader>
<CardContent>
<div class="text-xl sm:text-2xl font-bold">{{ displayStats[item.key as keyof Stats] }}</div>
<div class="text-xl sm:text-2xl font-semibold">{{ displayStats[item.key as keyof Stats] }}</div>
</CardContent>
</Card>
</div>