Skip to content

Commit a3dc392

Browse files
committed
fix: switch linenums_style to table and remove duplicate CSS counters
1 parent 46cf1e6 commit a3dc392

2 files changed

Lines changed: 1 addition & 31 deletions

File tree

docs/stylesheets/extra.css

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,3 @@
11
/* 自定义样式 */
22

33
/* 可在此处添加全局样式覆盖 */
4-
5-
/* 代码块行号显示 (pymdownx-inline 模式) */
6-
code .hll { display: block; }
7-
code [id^="__span"] {
8-
display: inline;
9-
}
10-
11-
/* 行号列 */
12-
.highlight [id^="__span"]::before {
13-
counter-increment: linenums;
14-
content: counter(linenums);
15-
display: inline-block;
16-
min-width: 2.5em;
17-
padding-right: 0.8em;
18-
margin-right: 0.5em;
19-
text-align: right;
20-
color: var(--md-default-fg-color--light);
21-
border-right: 1px solid var(--md-default-fg-color--lighter);
22-
user-select: none;
23-
-webkit-user-select: none;
24-
}
25-
26-
.highlight pre {
27-
counter-reset: linenums;
28-
}
29-
30-
/* 行号高亮时的样式 */
31-
.highlight [id^="__span"]:target {
32-
background-color: var(--md-code-hl-color);
33-
}

mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ markdown_extensions:
324324
line_spans: __span
325325
pygments_lang_class: true
326326
linenums: true
327-
linenums_style: pymdownx-inline
327+
linenums_style: table
328328
- pymdownx.inlinehilite
329329
- pymdownx.superfences:
330330
custom_fences:

0 commit comments

Comments
 (0)