Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant change the Icon hover effect #98

Open
jerviechronix opened this issue Apr 23, 2021 · 1 comment
Open

Cant change the Icon hover effect #98

jerviechronix opened this issue Apr 23, 2021 · 1 comment

Comments

@jerviechronix
Copy link

image

I cant override the hover effect of the Icon.

@SnekCode
Copy link

SnekCode commented Aug 1, 2021

Hello!

Start with a style hook like so

const useStyles = makeStyles((theme) => ({
  searchIconButton: {
    backgroundColor: "#EFD26E",
    position: "relative",
    "&:hover": {
      backgroundColor: "green",
    },
  },
}));

grab the classes object that is returned from that hook const classes = useStyles();

then in your component use the classes

const Component = () => {
const classes = useStyles();

     return ( 
       <SearchBar
           classes={{
            searchIconButton: classes.searchIconButton, 
            }}
      />
)
}

Screen Shot 2021-08-01 at 3 55 56 AM

Screen Shot 2021-08-01 at 3 55 32 AM

This stack overflow helped a lot for this answer!
https://stackoverflow.com/a/67920344

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

No branches or pull requests

2 participants