pcb-retrace/docs/cmms-schema-light.css
Stuart eeb2af1e15 CMMS fork: Phase 6 polish — schema.html light theme + load-time IndexedDB wipe
- cmms-bridge.js: wipeProjectData() clears the project object stores (devices,
  boards, components, images, overlappedImages, nets, schemas, schemaComponents
  — not the KiCad symbol library) and resets studio.js's shared globals before
  the CMMS attachment ZIP is imported. The ZIP is the single source of truth for
  a CMMS board, so restoreDevice()'s merge path (which only de-dupes on a newer
  meta.lastModified, absent on CMMS-created boards) no longer accretes duplicate
  image/net rows across repeated opens. init() also stamps data-theme=light as
  well as =dark. All gated on PCBRETRACE_CONFIG — standalone untouched.
- schema.html: inline head script mirrors ?theme=light|dark (passed by studio.js
  on the iframe src) onto <html> and, for light, injects cmms-schema-light.css.
  Full no-op with no ?theme=.
- cmms-schema-light.css (new): [data-theme="light"]-gated override of
  schema.html's :root palette for the CMMS light theme. Canvas stays dark.
- studio.js: append ?theme=<active> to the schema.html iframe src.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-09 22:08:45 +10:00

40 lines
1.8 KiB
CSS

/*
* CMMS light theme for pcb-retrace schema.html (the "Schema ReTrace" iframe).
*
* NOT part of the fork. schema.html is dark-only upstream, which clashes when
* the CMMS is in light mode. studio.js appends ?theme=light|dark to the iframe
* src (from the CMMS-set data-theme on the parent document); an inline script
* in schema.html mirrors it onto <html data-theme>. Every rule here is gated on
* [data-theme="light"] so standalone use and CMMS dark mode are untouched.
*
* The schematic canvas (#sch-canvas, painted by schema/draw.js with hardcoded
* colours) deliberately stays dark — it reads as a drawing surface, like an EDA
* canvas, not UI chrome. Only the surrounding panels/header/modals are themed.
*/
:root[data-theme="light"] {
--bg: #ffffff;
--surface: #f6f8fa;
--surface2: #eaeef2;
--border: #d0d7de;
--accent: #0a7d5f;
--accent2: #0969da;
--accent3: #cf400b;
--warn: #9a6700;
--text: #1f2328;
--text2: #656d76;
}
/* Canvas overlays hardcode the dark page bg — flip to a light scrim. */
[data-theme="light"] #coord-readout,
[data-theme="light"] #zoom-ind { background: rgba(255,255,255,.82); }
[data-theme="light"] #hint-bar { background: rgba(255,255,255,.9); color: var(--text2); }
/* Mobile drawer / toolbar shadows are tuned for a dark bg. */
[data-theme="light"] #left-panel { box-shadow: 4px 0 15px rgba(140,149,159,.35); }
[data-theme="light"] #right-panel { box-shadow: -4px 0 15px rgba(140,149,159,.35); }
[data-theme="light"] #canvas-toolbar .btn { box-shadow: 0 2px 8px rgba(140,149,159,.35); }
/* Selection tints read as near-invisible on white — lift them slightly. */
[data-theme="light"] .net-item.selected,
[data-theme="light"] .db-item.selected { background: rgba(10,125,95,.12); }
[data-theme="light"] .comp-item.selected { background: rgba(9,105,218,.12); }