reactjs MUI override style with parent reference

i want to override on specific component with parent reference, like search input text on datatable, right now i override the whole input to achive this

overrides:{ 
    mycomponentselector: { 
       MuiPaper: {
          MuiTabs: {
              PrivateTabIndicator: {
                  root: {
                     backgroundColor: 'red'
                  }
              }
          }
       }
   } 
}

reference to override

this is one of the example where i want to remove underline on the input search datatable but i end up override the whole input

enter image description here

i am sorry for my bad explanation, thanks in advance

Upvotes: 0

Views: 1425

Answers (1)

NearHuscarl
NearHuscarl

Reputation: 81763

Here is how you can select the component only if it's inside a parent component (in this example the parent component is Card)

overrides: {
  MuiCard: {
    root: {
      "& .MuiInputBase-root:not(.Mui-disabled)": {
        "&::before, &::after": {
          borderBottom: "none !important"
        }
      }
    }
  }
}

Live Demo

Edit Material-UI TextField Underline Override

Upvotes: 1

Related Questions