abdullahtarawneh.com/assets/scss/components/table-of-contents.scss
2024-03-14 18:29:33 -05:00

41 lines
748 B
SCSS

/* === 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;
}