Angular Side navbar , How to change background color ?


Topic: Angular Side navbar , How to change background color ?

winitserver2018 asked 6 years ago

How to change background color ? for Angular side navbar

Alberto pro answered 6 years ago

.sn-bg-1 {
background-image:none!important; //removes the image
background-color: $brand-maroon!important
}

This works for me in development. In production it reverts to the original color so I'd like to understand how too.


Damian Gemza staff answered 6 years ago

Hey guys, You can easily change background color of sidenav by adding color class to <mdb-sidenav> element. For example:
<mdb-sidenav #sidenav class="fixed green darken-4" [fixed]="true">
Here's a link to the sidenav documentation. There you can read about changing color of sidenav: https://mdbootstrap.com/angular/advanced/sidenav/
Best Regards,
Damian

Alberto pro commented 6 years ago

Yes but the problem here is if you have a custom colour your palette doesn't cover; I guess the other option would be to ispect your color css class and change it accordingly.

Damian Gemza staff commented 6 years ago

Alberto, did you tried to put this class in global stylesheet? For me it's working fine: .sn-bg-1 { background-image: none !important; background-color: red !important; } Best Regards, Damian

Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue
  • User: Free
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No