{"pageProps":{"metadata":{"date":"\"2021-06-20 10:31:00 +08:00\"","date_modified":"\"2021-06-20 18:16:24 +08:00\"","language":"en","source":""},"title":"Implementing tiered headings with CSS","hast":{"type":"root","children":[{"type":"element","tagName":"nav","properties":{"className":"toc"},"children":[{"type":"element","tagName":"ol","properties":{"className":"toc-level toc-level-1"},"children":[]}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"You may have seen certain documents with "},{"type":"element","tagName":"a","properties":{"href":"https://practicaltypography.com/hierarchical-headings.html"},"children":[{"type":"text","value":"tiered headings"}]},{"type":"text","value":".\nTo implement this with pure CSS, we'll make heavy use of "},{"type":"element","tagName":"a","properties":{"href":"https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Lists_and_Counters/Using_CSS_counters"},"children":[{"type":"text","value":"CSS counters"}]},{"type":"text","value":".\n"}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Here is one rough implementation with SCSS.\n"}]},{"type":"element","tagName":"pre","properties":{"className":["src-block"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-scss"]},"children":[{"type":"text","value":"article {\n // Named after the LaTeX counters after `chapter` counter.\n counter-reset: section subsection subsubsection paragraph subparagraph;\n --counter-spacing: 0.5rem;\n\n //