feat: light/dark theme support

Add a Theme preference (Automatic / Light / Dark). Automatic follows the
system org.gnome.desktop.interface color-scheme; the dark theme is
unchanged. Light styling lives in light.css, every rule scoped under a
.strata-theme-light class the panel toggles on its root box, loaded into the
St theme context by the extension. St's CSS engine has no custom properties,
so this specificity-based scoped override is how the palette is switched
without generating a stylesheet at runtime; switching is a single class
toggle off the ingest/render hot paths.

Also in this change:
- fix: the keyboard shortcut now hides the panel when it is already open.
  The binding lacked Shell.ActionMode.POPUP, so while the panel's modal grab
  was active the second press was swallowed and toggle() never ran.
- fix: the search placeholder ("Search...") is now legible in the light
  theme; it previously inherited a light-on-dark Shell color.
- pack: bundle light.css via --extra-source (gnome-extensions pack only
  auto-includes stylesheet.css), so packaged installs ship the light theme.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Eduard Tolosa 2026-05-26 14:49:08 -05:00
parent 42230470fc
commit 945ad61bf7
11 changed files with 328 additions and 9 deletions

View file

@ -277,6 +277,23 @@ image.
path in Strata executes clipboard content (no `spawn`, no
`launch_uri`, no `show_uri`).
## Theming
St's CSS engine has no custom properties (`var()`) and no reliable
`!important`, so the light theme is not a runtime-generated stylesheet.
Instead `stylesheet.css` is the dark theme (default, auto-loaded by GNOME),
and `light.css` carries light overrides with every rule scoped under a
`.strata-theme-light` ancestor class. That scoping makes each light rule
strictly more specific than its dark counterpart, so it wins
deterministically regardless of stylesheet load order. `extension.js` loads
`light.css` into the St theme context once at `enable()` (and re-loads it on
theme-context `changed`, since a Shell-theme swap drops dynamically loaded
sheets); it does nothing until the panel adds the class. The panel resolves
the effective theme from the `theme` setting (`auto` consults
`org.gnome.desktop.interface color-scheme`) and toggles the class on its
root box. Switching themes is one class toggle on an existing subtree, off
the ingest/render hot paths.
## Wayland clipboard monitor
The daemon contains a `wl-clipboard-rs` monitor for `ext-data-control-v1`