tailwind-variants icon indicating copy to clipboard operation
tailwind-variants copied to clipboard

compoundSlots unable to infer slots passed into 'extend'

Open binaryartifex opened this issue 6 months ago • 0 comments

Describe the bug As the title suggests, 'compoundSlots' is unable to infer slots passed into 'extend'

To Reproduce

export const baseStyles = tv({
  slots: {
    base: "bg-neutral-300",
  },
});

export const componentStyles = tv({
  extend: baseStyles,
  slots: {
    something: "text-neutral-800",
  },
  compoundSlots: [
    {
      slots: ["something","base"], // infers 'something', unable to infer 'base'
      className: "shadow-sm" 
    }
  ]
})

Expected behavior Able to infer extended slots without the need to provide empty placeholders

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser: Chrome
  • Version: 120.0.6099.110

binaryartifex avatar Dec 22 '23 01:12 binaryartifex