Skip to content

Nested groups #6034

Answered by reinink
EinLinuus asked this question in Help
Nov 9, 2021 · 3 comments · 6 replies
Discussion options

You must be logged in to vote

Hey! Good news — we just added nested group and multiple peer support using variant modifiers in Tailwind CSS v3.2 🥳

You can read about it in our announcement blog post, but for quick reference here’s what it looks like:

<div class="group/sidebar ...">
  <!-- ... -->
  <div class="group/navitem ...">
    <a
      href="#"
      class="opacity-50 group-hover/sidebar:opacity-75 group-hover/navitem:bg-black/75"
    >
      <!-- ... -->
    </a>
  </div>
  <!-- ... -->
</div>

This lets you give each group a clear name that makes sense for that context on the fly, and Tailwind will generate the necessary CSS to make it work.

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@EinLinuus
Comment options

@mati-1
Comment options

@sridhar-neartekpod
Comment options

@NotNikita
Comment options

@Jervx
Comment options

Answer selected by EinLinuus
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
8 participants