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) { @media (max-width: 639px) {
body { body {
font-size: 15.5px; font-size: 15.5px;
font-weight: 500;
line-height: 1.55; line-height: 1.55;
letter-spacing: -0.01em; letter-spacing: -0.01em;
/* 移动端使用 antialiased 以匹配高 DPI 渲染,开启字重补偿 */ /* 移动端使用 antialiased 以匹配高 DPI 渲染 */
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
@@ -257,28 +256,28 @@
line-height: 1.3; line-height: 1.3;
} }
/* 正文与描述类文字同步加厚,使用标准字重 500 以匹配静态字体 */ /* 正文与描述类文字回归 400,依靠 15.5px 的字号保证清晰度 */
p, p,
span:not([class*="icon"]), span:not([class*="icon"]),
label, label,
[class*="description"], [class*="description"],
[class*="muted"], [class*="muted"],
.text-muted-foreground { .text-muted-foreground {
font-weight: 500; font-weight: 400;
line-height: 1.6; line-height: 1.6;
} }
/* 针对移动端小字进行字重补偿,使用标准字重 600 */ /* 针对移动端小字保持适度加重 */
.text-xs { .text-xs {
font-size: 12.5px; font-size: 12.5px;
font-weight: 600; font-weight: 500;
line-height: 1.4; line-height: 1.4;
letter-spacing: 0.01em; letter-spacing: 0.01em;
} }
.text-sm { .text-sm {
font-size: 14.5px; font-size: 14.5px;
font-weight: 500; font-weight: 400;
line-height: 1.5; line-height: 1.5;
} }
+1 -1
View File
@@ -32,7 +32,7 @@ const { theme, setTheme } = useTheme()
</DropdownMenuItem> </DropdownMenuItem>
<DropdownMenuItem @click="setTheme('system')" class="gap-2"> <DropdownMenuItem @click="setTheme('system')" class="gap-2">
<Monitor class="h-4 w-4" /> <Monitor class="h-4 w-4" />
<span>跟随系统</span> <span>系统</span>
</DropdownMenuItem> </DropdownMenuItem>
</DropdownMenuContent> </DropdownMenuContent>
</DropdownMenu> </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"> <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 }"> <RouterLink v-for="item in navItems" :key="item.to" :to="item.to" custom v-slot="{ navigate }">
<Button variant="ghost" <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)"> @click="handleNavClick(navigate)">
<component :is="item.icon" class="h-4 w-4" /> <component :is="item.icon" class="h-4 w-4" />
{{ item.label }} {{ item.label }}
@@ -160,7 +165,7 @@ onMounted(() => {
<Menu class="h-5 w-5 text-muted-foreground" /> <Menu class="h-5 w-5 text-muted-foreground" />
</Button> </Button>
<div class="flex flex-col sm:flex-row sm:items-baseline sm:gap-2 truncate"> <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="hidden sm:inline">{{ sentence }}</span>
<span class="sm:hidden">{{ sentenceContent }}</span> <span class="sm:hidden">{{ sentenceContent }}</span>
</span> </span>
@@ -208,8 +213,7 @@ onMounted(() => {
@media (max-width: 639px) { @media (max-width: 639px) {
.poem-sentence { .poem-sentence {
font-weight: 400 !important; /* 与卡片标题保持一致,使用标准 font-medium 并取消淡化 */
opacity: 0.7 !important;
letter-spacing: 0.01em; 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" <Card v-for="item in statItems" :key="item.key" class="cursor-pointer hover:bg-accent/50 transition-colors"
@click="navigateTo(item.route)"> @click="navigateTo(item.route)">
<CardHeader class="flex flex-row items-center justify-between space-y-0 pb-2"> <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" /> <component :is="item.icon" class="h-4 w-4 text-muted-foreground" />
</CardHeader> </CardHeader>
<CardContent> <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> </CardContent>
</Card> </Card>
</div> </div>