JSFiddle - React, Tailwind, and code Playground

by dhavaljani

HTML

<ul>
<li class="parent active">Something
  <ul>
    <li>something</li>
    <li class="child active">something else</li>
    <li class="child">another thing</li>
    </ul>
  </li>
  <li class="parent">anything</li>
  <li class="parent">nothing</li>
 </ul>

CSS

li.active {
  color: red;
}
li > ul>li.active {
  color: green;
}
li+li.active > ul >li.active {
  color: orange;
}