This commit is contained in:
2026-01-01 11:05:23 +08:00
parent 3a0440296b
commit e5e385f51b
6 changed files with 43 additions and 63 deletions

View File

@@ -11,7 +11,7 @@
width: 5.25rem;
padding-right: 1rem;
text-align: right;
color: #999999;
color: white;
user-select: none;
font-size: 0.85em;
}

View File

@@ -3,7 +3,6 @@
/* @import url("https://fontsapi.zeoseven.com/292/main/result.css"); */
@import "tailwindcss";
@import "@nuxt/ui";
@import "code.css";
@plugin "@tailwindcss/typography";
@plugin "@tailwindcss/forms";
@tailwind utilities;
@@ -20,6 +19,27 @@
--font-roboto: "LXGW WenKai", sans-serif;
} */
/* 先定义计数器 */
pre[class*="language-"] {
counter-reset: line;
}
/* 每个代码行 <span> / <div> 前自增计数并打印 */
pre[class*="language-"] code > * {
counter-increment: line;
position: relative;
padding-left: 3rem; /* 行号留出空间 */
}
pre[class*="language-"] code > *::before {
content: counter(line);
position: absolute;
left: 0;
width: 2rem;
text-align: right;
color: #6b7280; /* Tailwind gray-500 */
}
@theme {
--font-roboto: "JetBrains Maple Mono", sans-serif;
--font-display: "JetBrains Maple Mono", sans-serif;