You simply cannot style input type file, the best approach is to create overlay element that will corespond with input type file.
With material you can style pretty much everything that has somthing to do with material, of corse you can add classes from material to custom components but that is not what material is for.
Simple example, you dont want to do that:
<div class="mat-card"></div>
If you can do this:
<mat-card></mat-card>
The same is with input, if you want it to be material style you should create somthing like this:
HTML:
<mat-card class="input-container">
<button #file mat-flat-button color="primary">Examinar...
<input multiple (change)="onFileSelected($event)" style="opacity: 0; position:absolute; left:0px; top:0px; width:100%; height:100%;" type="file"/>
</button>
{{files|json}}
</mat-card>
TS:
files: string[] = [];
onFileSelected(event) {
if (event.target.files.length > 0) {
for (let i = 0; i < event.target.files.length; i++) {
this.files.push(event.target.files[i].name);
console.log(event.target.files[0].name);
}
}
}
CSS:
.input-container {
position:relative;
}
Thats a simple example.
But i will still prefer to use some kind of npm package like : https://www.npmjs.com/package/ngx-dropzone