Skip to content

Commit c68725b

Browse files
committed
feat(site): 导航栏补当前页高亮,赞助商入口不额外加粗
导航此前没有任何当前页标识。参考站看着「赞助商」更重,是因为停在 该页时的 active 态(其导航项统一 font-medium,active 只把颜色从 muted 提到 foreground,字重不变),并非给赞助位单独加粗。 照此实现:停在 /sponsors 时该项颜色提亮 + aria-current="page", 其余情况与其他导航项完全一致。不给商业位额外字重——导航里单独加粗 一项会被读成「当前页」,点进去发现不是反而困惑。 三语页面同步生效。
1 parent ae316d8 commit c68725b

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

site/build.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ ${extraHead}</head>
652652
<a href="${base}index.html#skills">${t.nav.skills}</a>
653653
<a href="${base}index.html#tools">${t.nav.tools}</a>
654654
<a href="${base}index.html#faq">${t.nav.faq}</a>
655-
<a href="${base}sponsors.html">${t.nav.sponsors}</a>
655+
<a href="${base}sponsors.html"${pageClean === 'sponsors' ? ' class="active" aria-current="page"' : ''}>${t.nav.sponsors}</a>
656656
<a href="https://aiolaola.com/?utm_source=sp1" target="_blank" rel="noopener">${t.nav.learn}</a>
657657
<a href="https://github.com/jnMetaCode/superpowers-zh" target="_blank" rel="noopener">${t.nav.github}</a>
658658
${langSwitch}

site/template/styles.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ body::before {
6969
.nav nav > * { flex: 0 0 auto; white-space: nowrap; }
7070
.nav nav a { color: var(--text-dim); transition: color .2s; }
7171
.nav nav a:hover { color: var(--text); }
72+
.nav nav a.active { color: var(--text); } /* 当前页:只提亮,不加粗 */
7273

7374
main { position: relative; z-index: 1; }
7475
section { max-width: var(--maxw); margin: 0 auto; padding: 80px 24px; }

0 commit comments

Comments
 (0)