rauschma,
@rauschma@fosstodon.org avatar

#CSS: AFAICT, it’s not possible to hide all HTML .fragment elements after one with the marker class .current

<ul>
<li class="fragment">One</li>
<li class="fragment current">Two</li>
<li class="fragment">Three</li>
</ul>

<div class="fragment">
First
</div>
<div class="fragment">
Second
</div>
<div class="fragment">
Third
</div>

Workaround via JavaScript: Add class .hidden to all .fragment elements and remove them, one by one (vs. “moving” class .current).

chriskirknielsen,
@chriskirknielsen@front-end.social avatar

@rauschma The selector you're after is .current ~ .fragment, :has(.current) ~ .fragment but I wrote it specifically for your example. A more complex DOM structure would require a more complex selector list.

rauschma,
@rauschma@fosstodon.org avatar

@chriskirknielsen Nice! Alas not generic enough for my use case.

keithjgrant,
@keithjgrant@front-end.social avatar

@rauschma @chriskirknielsen A tilde combinator is exactly what I was going to suggest. Why isn't it generic enough?

  • All
  • Subscribed
  • Moderated
  • Favorites
  • CSS
  • kavyap
  • thenastyranch
  • Durango
  • DreamBathrooms
  • ngwrru68w68
  • magazineikmin
  • cubers
  • Youngstown
  • mdbf
  • slotface
  • osvaldo12
  • GTA5RPClips
  • rosin
  • InstantRegret
  • provamag3
  • everett
  • tacticalgear
  • vwfavf
  • tester
  • normalnudes
  • modclub
  • ethstaker
  • khanakhh
  • cisconetworking
  • anitta
  • Leos
  • megavids
  • JUstTest
  • All magazines