Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing the grey overlay/backdrop from $mdSidenav

I use some components from Angular Material in my project, and I have some issues with removing the grey overlay/backdrop for the service $mdSidenav, because I don't see where I can configure it.

As I don't want to hack the core code in Angular material, I am wondering what's the best way of removing the grey overlay/backdrop when the side nav panel slides in (active). Could someone point me to where I can configure or override the grey overlay? Thanks

like image 448
TonyGW Avatar asked Oct 25 '15 18:10

TonyGW


People also ask

How do you close a Sidenav mat?

A <mat-sidenav> can be opened or closed using the open() , close() and toggle() methods.

How do you fix Sidenav mats?

For <mat-sidenav> only (not <mat-drawer> ) fixed positioning is supported. It can be enabled by setting the fixedInViewport property. Additionally, top and bottom space can be set via the fixedTopGap and fixedBottomGap. These properties accept a pixel value amount of space to add at the top or bottom.

What is MatDrawer?

MatDrawer. This component corresponds to a drawer that can be opened on the drawer container. Selector: mat-drawer.

What is Sidenav?

The <mat-sidenav>, an Angular Directive, is used to create a side navigation bar and main content panel with material design styling and animation capabilities. <mat-sidenav-container> - Represents the main container. <mat-sidenav-content> - Represents the content panel. <mat-sidenav> - Represents the side panel.


2 Answers

You can use the built-in Angular Material attribute directive md-disable-backdrop. It accepts a boolean value and, when present in the markup, the sidenav will not show a backdrop.

<md-sidenav md-disable-backdrop>
</md-sidenav>
like image 180
Dor Cohen Avatar answered Sep 19 '22 22:09

Dor Cohen


Using CSS:

md-backdrop.md-sidenav-backdrop{
    display:none
}

Warning: This could break user functionality.

like image 29
gusjap Avatar answered Sep 17 '22 22:09

gusjap