mirror of
https://github.com/alex-shpak/hugo-book.git
synced 2024-11-28 14:10:14 +00:00
37 lines
675 B
SCSS
37 lines
675 B
SCSS
$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;
|
|
}
|
|
}
|
|
}
|