JSFiddle - React, Tailwind, and code Playground

by mamounothman

HTML

<ol>
    <li>one
        <ol>
            <li>one.one
                <ol>
                    <li>one.one.a</li>
                    <li>one.two.b</li>
                    <li>one.three.c</li>
                </ol>
            </li>
            <li>one.two</li>
            <li>one.three</li>
        </ol>
    </li>
    <li>two</li>
    <li>three</li>
</ol>

CSS

ol {
  counter-reset: section;                /* Creates a new instance of the
                                            section counter with each ol
                                            element */
  list-style-type: none;
}

li::before {
  counter-increment: section;            /* Increments only this instance
                                            of the section counter */
  content: counters(section, ".") " ";   /* Combines the values of all instances
                                            of the section counter, separated
                                            by a period */
}