|
1 |
| -$startLevel: 1; |
2 |
| -$endLevel: 6; |
3 |
| - |
4 | 1 | .book-page .markdown {
|
5 | 2 | counter-reset: h1 h2 h3 h4 h5 h6;
|
6 | 3 | }
|
7 | 4 |
|
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; |
23 | 8 | }
|
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; |
49 | 54 | }
|
0 commit comments