Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.

Styles don't apply to compound variant descendants #489

Closed
mattaningram opened this issue Oct 18, 2023 · 2 comments
Closed

Styles don't apply to compound variant descendants #489

mattaningram opened this issue Oct 18, 2023 · 2 comments
Assignees

Comments

@mattaningram
Copy link

I am attempting to customize the styles of a Button component setup with ButtonText. Styling with variants and compound variants works fine for default state styling of the descendants, and I can style the root element in :hover and :active states. But styles applied to descendants when the parent component is in a different state don't work.

Am I doing something wrong or is this a bug?

Text does change color on hover

variant: {
  solid: {
    _text: {
      color: 'white',
    },
    ':hover': {
      _text: {
        color: '$gray2'
      },
    },
  },
},

Text does not change color on hover

compoundVariants: [
{
  variant: 'solid',
  color: 'primary',
  value: {
    _text: {
      color: '$primary0',
    },
    ':hover': {
      _text: {
        color: '$primary1'
      },
    },
  },
},
]
@ankit-tailor
Copy link
Contributor

Hey @mattaningram, Thanks for reporting the issue. I'll look into it.

@ankit-tailor
Copy link
Contributor

The issue is fixed in the latest version. Let me know if it works for you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants