JSFiddle - React, Tailwind, and code Playground

HTML

<ol>
    <li>Food
        <ol>
            <li>Vege
                <ol>
                    <li>Carrot
                        <ol>
                            <li>White Carrot</li>
                            <li>Red Carrot</li>
                        </ol>
                    </li>
                </ol>
            </li>
            <li>Meat
                <ol>
                    <li>Chicken</li>
                    <li>Beef</li>
                </ol>
            </li>
        </ol>
    </li>
    <li>Beverages</li>
</ol>

CSS

ol {
  list-style-type: none;
  counter-reset: item;
  margin: 0;
  padding: 0;
}

li {
  display: table;
  counter-increment: item;
  margin-bottom: 0.6em;
}

li:before {
    content: counters(item, ".") ". ";
    display: table-cell;
    padding-right: 0.6em;    
}

li li {
    margin: 0;
}

li li:before {
    content: counters(item, ".") " ";
}

li li li:before {
    content: counter(item, lower-alpha) ". ";
}

li li li li:before {
    content: counter(item, lower-roman) ". ";
}