mirror of
https://github.com/alex-shpak/hugo-book.git
synced 2024-11-22 11:29:28 +00:00
37 lines
704 B
SCSS
37 lines
704 B
SCSS
$startLevel: 1;
|
|
$endLevel: 6;
|
|
|
|
.book-page .markdown.book-article {
|
|
@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#TableOfContents ul {
|
|
li {
|
|
counter-increment: item;
|
|
|
|
&:first-child {
|
|
counter-reset: item;
|
|
}
|
|
|
|
&:before {
|
|
content: counters(item, ".") ". ";
|
|
float: left;
|
|
margin-inline-end: $padding-4;
|
|
}
|
|
}
|
|
}
|