How remove background from Angular Material Tree

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;
}

Upvotes: 1

Views: 1254

Answers (3)

viltor
viltor

Reputation: 341

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;
}

Upvotes: 0

shourov_return0
shourov_return0

Reputation: 73

Use this...it's may working fine

  .mat-tree {
      background: transparent;
    }
      

Upvotes: 1

Joosep Parts
Joosep Parts

Reputation: 6235

Adding this to style.css should work.

.mat-tree {
    background-color: transparent !important;
}

Upvotes: 1

Related Questions