0.4.1
A WCAG AA code-panel editor theme that follows the page's color scheme and can be themed by the host.
Released: 2026-09-27
This release replaces the code panel's fixed dark editor theme with an engine-owned theme that meets WCAG AA text contrast, follows the page's light or dark scheme, and exposes the editor colors as host-overridable tokens.
Features
Color the code panel's CodeMirror editors from 16
--sg-code-*custom properties (background, text, gutter, active line, selection, cursor, and nine syntax roles). Their defaults arelight-dark()pairs chosen so every text and syntax color reaches at least 4.5:1 against the surface it sits on, so the editor is light on light pages, dark on dark pages, and switches when the page theme toggles. Override any token on:rootto match the host's palette.Highlight the active line and its gutter number in the editable Live CSS editor. The read-only source view is unchanged.
Add an
extensionsoption toSourceEditorfor hosts that mount it directly. The engine theme is low precedence, so a host-supplied CodeMirror theme wins on conflicting rules. It is read once at mount, likevalue.
Bug Fixes
The editor gutter and comment text no longer fall below WCAG AA contrast: the previous
oneDarktheme drew them at 3.86:1 and stayed dark on light pages.@codemirror/theme-one-darkis no longer a dependency.