.table-of-contents { &__title { margin-block-start: 1em; margin-block-end: 0.5em; font-weight: 900; text-transform: uppercase; font-size: 1rem; &:before { content: '' !important; // if autonumbering is enabled, remove it from the heading counter-reset: h2 // and don't increment the count for the rest of the content } } ul, ol { list-style: none; margin: 0; padding: 0; } li { margin-block: 0.5em; margin-inline: 0; line-height: 1.5; } a { display: inline; } li > ul, li > ol { /* indent subheadings */ margin-inline-start: 1em; } } // the shortcode version can't be overridden for some reason... #TableOfContents:not(.table-of-contents) { ul, ol { list-style: none; margin: 0; padding: 0; } li { margin-block: 0.5em; margin-inline: 0; line-height: 1.5; } a { display: inline; } li > ul, li > ol { /* indent subheadings */ margin-inline-start: 1em; } } // hide toc shortcode if page-wide toc is enabled *[has-toc] { #TableOfContents:not(.table-of-contents) { display: none; } }