Skip to content

Select a recipe's slot inside another slot in the recipe definition #2331

Answered by astahmer
RemyMachado asked this question in Q&A
Discussion options

You must be logged in to vote

hey, recipes have deterministic className generation based on this: ${className}__${slotName}

const button = defineRecipe({
  className: 'btn',
  slots: ['root', 'text'],
  base: {
    root: {
      bg: 'blue.500',
      _hover: {
        // v--- 🎯 this will target the `text` slot
        '& .btn__text': {
          color: 'white',
        },
      },
    },
  },
})

also, I just added a PR to do the same with sva #2348

Replies: 1 comment 1 reply

Comment options

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

Answer selected by RemyMachado
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants