Repository navigation
Tags: openpatch/sql-ide
Tags
hyperbook: follow the page's dark-mode-toggle A hyperbook carries a <dark-mode-toggle> its reader can flip, and an IDE embedded in the page should be in the same colours as the text around it rather than a dark rectangle in a light page. With no `theme` in the config, the theme now comes from that element - its `mode` property, falling back to the attribute for the moment before the custom element has been upgraded - and follows it live through the component's `colorschemechange` event, so flipping the toggle re-themes the IDE without a reload. It re-reads once whenDefined() resolves as well, so a toggle whose script loads after the IDE still gets honoured. An explicitly configured theme still wins, and a page with no toggle says nothing about its colours, so the IDE stays dark there.