abdullahtarawneh.com/assets/scss/components/table-of-contents.scss

41 lines
748 B
SCSS
Raw Normal View History

2024-03-14 23:29:33 +00:00
/* === ordered: true === */
#TableOfContents ol {
/*
each list gets a new counter
*/
counter-reset: item;
margin-inline-start: 0;
list-style: none;
}
#TableOfContents ol li:before {
/*
the counter is added as a pseudo-element,
and nested counters are joined by a dot
*/
content: counters(item, ".") " ";
counter-increment: item;
/* ensure the counters align visually */
font-family: monospace;
font-weight: bold;
margin-inline-end: 1em;
}
#TableOfContents > ol > li {
/*
top-level items wrap after the number,
in order to add some visual separation
*/
display: flex;
flex-flow: column;
}
/* === ordered: false === */
#TableOfContents ul {
list-style: none;
margin-left: 0;
}
#TableOfContents ul ul {
margin-left: 1em;
}