You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
675 B
SCSS
37 lines
675 B
SCSS
2 years ago
|
$startLevel: 1;
|
||
|
$endLevel: 6;
|
||
|
|
||
|
.book-page .markdown {
|
||
|
@for $currentLevel from $startLevel through $endLevel {
|
||
|
> h#{$currentLevel} {
|
||
|
counter-increment: h#{$currentLevel};
|
||
|
counter-reset: h#{$currentLevel + 1};
|
||
|
|
||
|
$content: "";
|
||
|
@for $n from $startLevel through $currentLevel {
|
||
|
$content: $content + 'counter(h#{$n})"."';
|
||
|
}
|
||
|
|
||
|
&::before {
|
||
|
content: unquote($content) " ";
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
.book-toc nav ul {
|
||
|
li {
|
||
|
counter-increment: item;
|
||
|
|
||
|
&:first-child {
|
||
|
counter-reset: item;
|
||
|
}
|
||
|
|
||
|
&:before {
|
||
|
content: counters(item, ".") ". ";
|
||
|
float: left;
|
||
|
margin-inline-end: $padding-4;
|
||
|
}
|
||
|
}
|
||
|
}
|