light-dark-switch

This module only changes the class names of html nodes, it does not provide any style to change the webpage.

Open F12.

No enable-sync

Toggle Toggle
          
<light-dark-switch>
  <button>Toggle</button>
</light-dark-switch>
          
        

With enable-sync

Toggle Toggle Toggle
          
<light-dark-switch enable-sync>
  <button>Toggle</button>
</light-dark-switch>
          
        

Disabled

(default, selected, enable-sync)

Toggle Toggle Toggle
          
<light-dark-switch disabled>
  <button>Toggle</button>
</light-dark-switch>
          
        
          
<light-dark-switch disabled selected>
  <button>Toggle</button>
</light-dark-switch>
          
        
          
<light-dark-switch disabled enable-sync>
  <button>Toggle</button>
</light-dark-switch>
          
        

Methods

Toggle
          
<light-dark-switch id="abc">
  <button>Toggle</button>
</light-dark-switch>

var button = document.getElementById('abc')
button.select()
button.unSelect()
button.enableSync()
button.disableSync()
button.isSelected()
button.isDisabled()
button.isSync()