{
  "format": "css.observer/playground@1",
  "id": "00000000-0000-4000-9000-000000000010",
  "url": "https://css.observer/s/pill-toggle-switch",
  "title": "Pill toggle switch",
  "description": "A real checkbox with role=switch, styled as a sliding pill. Keyboard and screen reader friendly.",
  "category": "forms",
  "tags": [
    "checkbox",
    "switch",
    "accessible"
  ],
  "visibility": "public",
  "status": "published",
  "revision": 1,
  "author": "observer",
  "forked_from": null,
  "created_at": "2026-12-02T05:26:36.930Z",
  "updated_at": "2026-12-02T05:26:36.930Z",
  "published_at": "2026-12-02T05:26:36.930Z",
  "source": {
    "html": "<label class=\"switch\"><input type=\"checkbox\" role=\"switch\" checked><span>Dark mode</span></label>",
    "css": "body { margin: 0; min-height: 100vh; display: grid; place-items: center; background: #16171a; color: #ecebe6; font: 16px system-ui, sans-serif; }\n.switch { --on: #c8f560; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }\n.switch input { appearance: none; margin: 0; width: 52px; height: 30px; border-radius: 999px; background: #34373f; position: relative; cursor: pointer; transition: background .2s; }\n.switch input::before { content: \"\"; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s cubic-bezier(.3,1.4,.6,1); }\n.switch input:checked { background: var(--on); }\n.switch input:checked::before { transform: translateX(22px); background: #13180a; }\n.switch input:focus-visible { outline: 2px solid var(--on); outline-offset: 3px; }",
    "js": ""
  }
}