1

I've tried to remove the background of my material tree but nothing seems to actually be working.

I want to maintain the background image, the background image is from the mat-sidenav-container the library.component is rendered on the mat-sidenav-content.

enter image description here

library.component.scss
mat-tree-node {
    background-color: transparent !important;
}

3 Answers 3

1

Adding this to style.css should work.

.mat-tree {
    background-color: transparent !important;
}
Sign up to request clarification or add additional context in comments.

Comments

1

Use this...it's may working fine

  .mat-tree {
      background: transparent;
    }
      

Comments

0

If you just want to hide the background-color in a specific component, can add it to the component css instead overwrite the mat-tree background-color for all the project.

::ng-deep .mat-tree {
    background-color: transparent;
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.