User User - 1 year ago 263
AngularJS Question

Is it possible to change the color of disabled active mdSwitch of Angular material?

I am using Angular Material md-switch. In documentation it is showing some different color when the switch is enabled. But I need a functionality like changing the color of switch when it is in Disabled Active. Please help me in acheving this. Thanks in advance.

<md-switch aria-label="Switch 11" ng-class="{'md-checked':database.somevalue.value['alarm']}"
ng-disabled="true"> Alarm

Answer Source

Here you go - CodePen

enter image description here


md-switch[disabled]#blah .md-container > div
  cursor: default;
  background: lightgreen;

md-switch[disabled]#blah .md-container > div > div
  background: green;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download