8000 fix(tooling): partial fix for firefox numbering (#1238) · filecoin-project/specs@d52fe97 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit d52fe97

Browse files
authored
fix(tooling): partial fix for firefox numbering (#1238)
1 parent 1a7c4c7 commit d52fe97

File tree

3 files changed

+59
-44
lines changed

3 files changed

+59
-44
lines changed

assets/plugins/_numbered.scss

Lines changed: 48 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,54 @@
1-
$startLevel: 1;
2-
$endLevel: 6;
3-
41
.book-page .markdown {
52
counter-reset: h1 h2 h3 h4 h5 h6;
63
}
74

8-
.book-page .markdown {
9-
@for $currentLevel from $startLevel through $endLevel {
10-
h#{$currentLevel} {
11-
counter-reset: h#{$currentLevel + 1} 0;
12-
counter-increment: h#{$currentLevel};
13-
}
14-
$content: '';
15-
@for $n from $startLevel through $currentLevel {
16-
$content: $content + 'counter(h#{$n})"."';
17-
}
18-
19-
h#{$currentLevel}::before {
20-
content: unquote($content) ' ';
21-
}
22-
}
5+
.book-page .markdown h1 {
6+
counter-reset: h2 0;
7+
counter-increment: h1;
238
}
24-
25-
.book-menu nav ol {
26-
li {
27-
counter-increment: item;
28-
29-
&:first-child {
30-
counter-reset: item;
31-
}
32-
33-
a:before {
34-
content: counters(item, '.') ' ';
35-
float: left;
36-
margin-inline-end: $padding-4;
37-
color: var(--gray-600);
38-
}
39-
&.active {
40-
&::before {
41-
content: '';
42-
color: var(--cl-blue);
43-
}
44-
> a::before {
45-
color: var(--cl-blue);
46-
}
47-
}
48-
}
9+
.book-page .markdown h1::before {
10+
content: counter(h1) '. ';
11+
margin-right: 4px;
12+
}
13+
.book-page .markdown h2 {
14+
counter-reset: h3 0;
15+
counter-increment: h2;
16+
}
17+
.book-page .markdown h2::before {
18+
content: counter(h1) '.' counter(h2) '.';
19+
margin-right: 4px;
20+
}
21+
.book-page .markdown h3 {
22+
counter-reset: h4 0;
23+
counter-increment: h3;
24+
}
25+
.book-page .markdown h3::before {
26+
content: counter(h1) '.' counter(h2) '.' counter(h3) '.' ' ';
27+
margin-right: 4px;
28+
}
29+
.book-page .markdown h4 {
30+
counter-reset: h5 0;
31+
counter-increment: h4;
32+
}
33+
.book-page .markdown h4::before {
34+
content: counter(h1) '.' counter(h2) '.' counter(h3) '.' counter(h4) '.' ' ';
35+
margin-right: 4px;
36+
}
37+
.book-page .markdown h5 {
38+
counter-reset: h6 0;
39+
counter-increment: h5;
40+
}
41+
.book-page .markdown h5::before {
42+
content: counter(h1) '.' counter(h2) '.' counter(h3) '.' counter(h4) '.'
43+
counter(h5) '.' ' ';
44+
margin-right: 4px;
45+
}
46+
.book-page .markdown h6 {
47+
counter-reset: h7 0;
48+
counter-increment: h6;
49+
}
50+
.book-page .markdown h6::before {
51+
content: counter(h1) '.' counter(h2) '.' counter(h3) '.' counter(h4) '.'
52+
counter(h5) '.' counter(h6) '.' ' ';
53+
margin-right: 4px;
4954
}

assets/plugins/_toc.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
.book-menu nav ol {
2+
li {
3+
&.active {
4+
&::before {
5+
content: '';
6+
color: var(--cl-blue);
7+
}
8+
}
9+
}
10+
}
111
.toc {
212
height: 100%;
313
> ol {

layouts/partials/toc.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<ol class="depth-{{ .depth }}{{ if ge .depth 2 }} maybe-hide{{ end }}">
44
{{ range .children }}
55
<li>
6-
<a href="#{{ .id }}">{{.text}}</a>
6+
<a href="#{{ .id }}">{{.number}} {{.text}}</a>
77
{{ if gt (len .children) 0 }}
88
{{ template "toc-list" (dict "children" .children "depth" (add 1 $depth) ) }}
99
{{ end }}

0 commit comments

Comments
 (0)
0