I am building an angular2 app using angular material2. I am trying to set the background of my application \"the correct way\", but I can\'t figure out how.
I found
for extra solution if previous didn't work i angular material 2 working with encapsulation style so whatever you gonna do you can't customize angular material component from outside so an ideal solution for that i always use try this
1- you can use this hack that gonna give you possibilities to customize angular material component if you want to by set ViewEncapsulation.None
//test.component.ts
import { ViewEncapsulation } from '@angular/core';
@Component({
selector: 'app-test',
templateUrl: '.....',
styleUrls: ['....'],
encapsulation: ViewEncapsulation.None
})
or
2- if you want just to change background you can simple try this
//style.css (main style file)
html, body {
background-color: #fafafa;
}
this gonna change the whole background color of all your app