Skip to content
Discussion options

You must be logged in to vote

I don't think there is currently a built-in solution for this. You would need to write custom plugin for that purpose.

There is an open PR for a children variant that may help. But for your particular case, you can write a simple plugin like this:

plugin(function({ addVariant }) {
  addVariant("open-menu", ".open-menu &");
})

And you can use the variant on the child:

<div class="child open-menu:m-[0.75rem]"></div>

However, for this particular use case of yours, it's probably better to just use CSS, since there is not much reuse, unless you have multiple children that behave differently when the menu is open.

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
1 reply
@igorkoho
Comment options

Answer selected by TefDesign
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@sntran
Comment options

@MuhammadRabi
Comment options

@Dupflo
Comment options

@spaceballstheuser
Comment options

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