Meher Chaitanya
Meher Chaitanya

Reputation: 123

unable to override styles in react material-ui appbar

I have made a custom component and I tried to use it in AppBar but the Styles are not overwritten. I have used makeStyles hook and it is working fine when I use it outside but when I use it in AppBar and ToolBar, I am not able to overwrite UI.

Here is my codeSandBox Link: https://codesandbox.io/s/inquisitorius-6l721?file=/src/Links/Links.js

Upvotes: 1

Views: 219

Answers (2)

alextrastero
alextrastero

Reputation: 4300

Adding zIndex to links would solve that:

const useStyles = makeStyles(() => ({
  links: {
    zIndex: 0,
    ...

Upvotes: 1

kuzditomi
kuzditomi

Reputation: 730

I can see that the same styling is applied to the Link in the AppBar too, however you can't see the underlining because of the negative z-index.

Upvotes: 0

Related Questions