Skip to content

Custom group modifier support? #18480

Discussion options

You must be logged in to vote

Ok leaving this to another who needs help with this in the future. @GaneshVarma1 really helped out and sent me in the right direction. The achieve a hocus variant that supports regular hocus:bg-red-400, group styling via group-hocus:bg-red-400 as well as group styling with variants such as group-hocus/row:bg-red-400 you can use the following snippets.

plugins: [
  function ({ addVariant, matchVariant, e }) {
      addVariant("hocus", ["&:hover", "&:focus-visible"]);
      matchVariant("group-hocus", (value, { modifier }) => {
        return modifier
          ? [`:merge(.group\\/${modifier}):hover &`, `:merge(.group\\/${modifier}):focus-visible &`]
          : [`:merge(.group):hover &`, `…

Replies: 2 comments 2 replies

Comment options

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

@VladyslavKochetkov
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by VladyslavKochetkov
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