Skip to content
Discussion options

You must be logged in to vote

Thank you for these detailed suggestions, @rozsazoltan.

I ended up going with a slight variation of your recommended approach:

<input type="radio" name="menu" class="peer/foo hidden" />

<div class="group">
  <div class="group-[.peer\/foo:checked~&]:hidden"></div>
</div>

As we only have one group, there's no need for named groups but we can still use the arbitrary selector and the subsequent sibling combinator to only make the inner div hidden when its group follows the checked, named peer checkbox.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@rozsazoltan
Comment options

@mudge
Comment options

Answer selected by mudge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants