Is it possible to change mat-divider
color?
I tried the following, it didn't work
component.html
<mat-divider class="material-devider"></mat-divider>
component.scss
.material-devider {
color: red
}
You need to overrule . mat-divider class styling in your own written CSS and change the border-top-color property. is the default styling by Angular Material. This should be enough to change it (if your CSS gets rendered later than Material's).
To change the thickness of the mat-divider, override the default border-top-width or border-top-style properties of . mat-divider class.
Inset dividers separate related content, such as sections in a list of contacts or emails in a conversation. Inset dividers should be used in conjunction with anchoring elements such as icons or avatars aligned with the Title Key Line. Example of inset divider.
Yes, you can.
You need to overrule .mat-divider
class styling in your own written CSS and change the border-top-color
property.
.mat-divider {
border-top-color: rgba(0, 0, 0, 0.12);
}
is the default styling by Angular Material.
.mat-divider {
border-top-color: red;
}
This should be enough to change it (if your CSS gets rendered later than Material's). Otherwise adding increased specificity to your CSS class will help (f.e..mat-divider.mat-divider
).
StackBlitz example for this case.
To change the color mat-divider simply change the border-top-color property of .mat-divider class.
.mat-divider {
border-top-color: red;
}
https://www.angularjswiki.com/angular/angular-material-divider-mat-divider-example/#mat-divider-color
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With