diff --git a/src/components/Header.astro b/src/components/Header.astro index ab6b5cb..0257481 100644 --- a/src/components/Header.astro +++ b/src/components/Header.astro @@ -122,4 +122,20 @@ const switchLabel = curLocale === 'zh' ? 'EN' : '中'; @media (max-width: 560px) { .nav-link { font-size: 14px; padding-inline: var(--space-1); } } + /* 移动端审计 B1:7 项一行在 390px 溢出 50-88px(主题钮被推出屏)—— + 更窄一档整体收紧,估算总宽 ~344px < 360 */ + @media (max-width: 430px) { + .brand { font-size: 16px; } + .nav-link { font-size: 12.5px; padding-inline: 3px; } + nav ul { gap: 2px; } + .header-inner { gap: 6px; padding-inline: 10px; } + /* 图标钮在此密度下 32px(WCAG 24px 下限之上,44 标准的密度妥协) */ + .header-inner .tap { min-width: 32px; min-height: 32px; } + .nav-lang { font-size: 12px; padding-inline: 2px; } + } + @media (max-width: 370px) { + /* en "Open Source" 长词最后 4px:再收字距 */ + .nav-link { font-size: 12px; padding-inline: 2px; } + .brand { letter-spacing: 0; } + } diff --git a/src/components/PostList.astro b/src/components/PostList.astro index f3e548d..e6ba575 100644 --- a/src/components/PostList.astro +++ b/src/components/PostList.astro @@ -84,7 +84,7 @@ const mmdd = (d: Date) => color: var(--ink-2); font-variant-numeric: tabular-nums; } - .shelf-link { float: right; font-size: 12.5px; color: var(--accent); font-weight: 400; } + .shelf-link { float: right; font-size: 12.5px; padding-block: 4px; color: var(--accent); font-weight: 400; } .track { display: flex; align-items: center; @@ -123,6 +123,10 @@ const mmdd = (d: Date) => flex: none; } .row-title { + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + overflow: hidden; flex: 1; min-width: 0; font-size: 16px; @@ -132,7 +136,11 @@ const mmdd = (d: Date) => white-space: nowrap; transition: color var(--dur) var(--ease); } - .row:hover .row-title { color: var(--accent); } + .row:hover .row-title { + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + overflow: hidden; color: var(--accent); } .tag { flex: none; font-family: var(--font-mono); diff --git a/src/components/geek/ProjectWall.astro b/src/components/geek/ProjectWall.astro index cca8fcb..460a3fc 100644 --- a/src/components/geek/ProjectWall.astro +++ b/src/components/geek/ProjectWall.astro @@ -3,11 +3,16 @@ // 双源数据见 src/lib/projects.ts;语言色点用 linguist 常用色映射 import { loadProjects, type RepoCard } from '../../lib/projects'; +import { t } from '../../i18n/ui'; +import type { Locale } from '../../lib/locale'; + interface Props { /** 展示上限:首页精选 6;/opensource 全量传大数 */ limit?: number; + locale?: Locale; } -const { limit = 6 } = Astro.props; +const { limit = 6, locale = 'zh' } = Astro.props; +const title = t('open_source_projects', locale); const LANG_COLORS: Record = { Astro: '#ff5a03', TypeScript: '#3178c6', JavaScript: '#f1e05a', Python: '#3572a5', Go: '#00add8', Rust: '#dea584', Shell: '#89e051', @@ -23,7 +28,7 @@ try { ---
-

开源 · Projects

+

{title}