Arvind Chourasiya
Arvind Chourasiya

Reputation: 17472

Is there any way to change disable state color of mat-slide-toggle

I want to change the color of disable state in mat-slide-toggle.

This is how slide toggle looking

enter image description here

This is my code

<div>
  <mat-slide-toggle>Slide me!</mat-slide-toggle>
</div>

How can I change gray bg color?

Upvotes: 0

Views: 2964

Answers (1)

Supun De Silva
Supun De Silva

Reputation: 1487

In the root style.scss do a global style override (Not recommended normally) as follows. After you import the material theme

Ref: https://material.angular.io/guide/customizing-component-styles

@import '~@angular/material/prebuilt-themes/indigo-pink.css';

....
....


.mat-slide-toggle-bar {
  background-color: #e47171 !important;
}

Image Ref of style import

enter image description here

Upvotes: 1

Related Questions