feat(toc): implement post table of contents and refactor line number component

这个提交包含在:
2026-01-30 15:48:29 +08:00 未验证
父节点 485920a46b
当前提交 3bca8e8635
修改 12 个文件,包含 403 行新增60 行删除
+54
查看文件
@@ -0,0 +1,54 @@
@import "variables";
.post-line-gutter {
position: absolute;
left: -80px;
top: 0;
width: 60px;
user-select: none;
opacity: 0.5;
border-right: 1px solid color-mix(in srgb, var(--foreground) 15%, transparent);
@media (max-width: $tablet-max-width) {
display: none;
}
.line-number {
position: absolute;
right: 8px;
display: flex;
align-items: center;
justify-content: flex-end;
padding-right: 10px;
font-size: 0.85rem;
color: var(--foreground);
transition: opacity 0.15s ease;
opacity: 0.8;
&:hover {
opacity: 1;
}
}
.line-number--gap {
opacity: 0.5;
}
.line-number--breakpoint {
cursor: pointer;
.line-breakpoint {
position: absolute;
right: -3px;
color: var(--brightRed);
font-size: 0.875rem;
font-family: Hack, Monaco, Consolas, monospace;
transition: transform 0.15s ease, filter 0.15s ease;
}
&:hover .line-breakpoint {
transform: scale(1.2);
filter: brightness(1.2);
}
}
}