Change 'switch' toggle color


Topic: Change 'switch' toggle color

Kneidels pro asked 6 years ago

Hi there

i see the code for the material switch is:

 <div class="switch">
  <label>
    Off
    <input type="checkbox">
    <span class="lever"></span> On
  </label>
</div>

but the toggle field created is purple. Are there classes available to change this, to see blue/red when in the active/on state?

Thanks


Bartłomiej Malanowski staff pro premium answered 6 years ago

There's no class to change the color of the switch component, but my snippet will show you how easy it is to change it


Kneidels pro commented 6 years ago

PERFECT - just what i needed.

Thanks!


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Resolved

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.7.5
  • Device: PC
  • Browser: Firefox
  • OS: Win10
  • Provided sample code: No
  • Provided link: No
Tags