JSFiddle - React, Tailwind, and code Playground

HTML

<stron>struktur</stron>
<ul>
    <li>
        <ul>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
        </ul>
    </li>
    <li>
        <ul>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
        </ul>
    </li>
</ul>

<strong>Ønsket css (talet til venster for Before)</br>
(b x) dvs værdi x
</strong>
<ul>
    <li>
        <ul>
            <li>x <- lige her er tallet 1</li>
            <li>2</li>
            <li>3</li>
            <li>4</li>
        </ul>
    </li>
    <li>
        <ul>
            <li>5</li>
            <li>6</li>
            <li>7</li>
            <li>8</li>
        </ul>
    </li>
</ul>

CSS

li:nth-child(1n)::before{
    content:"1 ";
}
li:nth-child(2)::before{
    content:"2 ";
}
li:nth-child(3)::before{
    content:"3 ";
}
li:nth-child(4)::before{
    content:"4 ";
}
li:nth-child(5)::before{
    content:"5 ";
}
li:nth-child(6)::before{
    content:"6 ";
}
li:nth-child(7)::before{
    content:"7 ";
}
li:nth-child(8)::before{
    content:"8 ";
}