If I have code like the example below and want to add the show
class to the parent and ancestors.
// The last `nav-item` has the `active` class
<div class="nested-group nested-item show">
<div class="nested-item show">
<div class="nested-item show">
<div class="nested-item show">
<a class="nav-item active" href="#">Lorem</a>
<a class="nav-item" href="#">Ipsum</a>
</div>
</div>
</div>
</div>
// The last `nav-item` does not have the `active` class
<div class="nested-group nested-item">
<div class="nested-item">
<div class="nested-item">
<div class="nested-item">
<a class="nav-item" href="#">Lorem</a>
<a class="nav-item" href="#">Ipsum</a>
</div>
</div>
</div>
</div>