mirror of
https://github.com/penpot/penpot.git
synced 2026-08-06 21:08:34 +00:00
Penpot itself and plugins used different default theme selection strategies when no theme is explicitly selected in Penpot by the user: - Penpot itself defaults to dark. - Plugins defaulted to whatever is configured in the user's system/browser, which could be light. So with no explicit theme chosen in the profile — the common state — every plugin could be told the theme was light while Penpot itself showed dark, both on open (penpot.theme) and on themechange. For every explicit choice (light, dark, system, and the legacy default) the two resolutions already agreed; only the unset case diverged. Extract the app's resolution into app.util.theme/resolve-theme (system follows the system theme; default and unset mean dark) as the single source of truth, and use it in the app's own use-initialize as well as in the plugin runtime's getTheme and themechange handling. The themechange handler's now-dead default-to-dark remapping is removed. Fixes #10676 AI-assisted-by: claude-fable-5