Naushad Ahmad
Naushad Ahmad

Reputation: 486

Create <md-switch> with icon in angular-material

How can I create this md-switch with icon?

I took example from www.inbox.google.com

enter image description here

Thanks

Upvotes: 0

Views: 523

Answers (1)

Greg
Greg

Reputation: 1402

You can add a background-image to the .md-thumb class

.md-thumb{    
  background: url('imageUrl');
  background-size: cover;
}

Edit:

Show icon on ON:

.md-checked .md-thumb{    
  background: url('imageUrl');
  background-size: cover;
}

Show icon on OFF:

.md-checked .md-thumb{    
  background: none;
}

.md-thumb{    
  background: url('imageUrl');
  background-size: cover;
}

Upvotes: 4

Related Questions