webpage/themes/hugo-book/assets/plugins/_numbered.scss
kekskurse 27e6a14105 init
2024-11-26 23:25:09 +01:00

34 lines
672 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 {
counter-reset: item;
li {
counter-increment: item;
&:before {
content: counters(item, ".") ". ";
float: left;
margin-inline-end: $padding-4;
}
}
}