Skip to content
Devix Open Source

Three states, not two

Light, dark and system — with the choice kept separate from what it resolves to, which a two-state switch cannot do.

Live preview
<div class="demo demo--wide">
  <div class="panel" id="panel">
    <div class="panel-head">
      <strong>A page</strong>
      <div id="theme"></div>
    </div>
    <p class="panel-body">This panel follows the toggle. So do the controls below — that is
      <code>color-scheme</code> doing its work, not CSS.</p>
    <p class="demo-row">
      <input class="demo-input" type="date" aria-label="A date">
      <select class="demo-input" aria-label="A menu"><option>A native menu</option></select>
    </p>
  </div>

  <div class="demo-row">
    <div id="button"></div>
    <span class="demo-hint">The same controller, as a cycling button.</span>
  </div>

  <dl class="demo-kv" id="out"></dl>
</div>