JSFiddle - React, Tailwind, and code Playground
HTML
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li class="more">
<ul>
<li>6</li>
<li>7</li>
<li>8</li>
<li>9</li>
</ul>
</li>
</ul>
CSS
.bg {
background: #ccc;
}
li:not(.more):nth-child(odd) {
//background: yellow;
}
JavaScript
$("li:not(.more):odd").addClass("bg")