Skip to content

feat(sdk): add light and dark themes - #63

Open
b0czek wants to merge 4 commits into
mainfrom
feat/themes
Open

b0czek wants to merge 4 commits into
mainfrom
feat/themes

Conversation

@b0czek

@b0czek b0czek commented Nov 27, 2026

Copy link
Copy Markdown
Owner

Summary

Adds light and dark themes to Eden.

  • Settings → Appearance shows the themes as a grid, with no separate light/dark toggle. Each theme is either light or dark. Selecting one sets Electron's color scheme (nativeTheme.themeSource), applies the theme's colors, and switches wallpaper presets to their light or dark variant. For example, Pure Black becomes Pure White.
  • Built-in themes: Eden Dark (the default) and Eden Light.
  • Consumer themes: consumers add themes and set the default through createEden({ appearance: { themes, defaultTheme } }). A theme overrides any --eden-color-* token, and tokens it leaves out keep the built-in values of its scheme. Eden validates the configuration at startup.
  • API: the host uses eden.appearance.getState(), getThemes(), setTheme() and onAppearanceChanged(). Apps use the appearance/get-appearance, appearance/get-themes and appearance/set-theme commands and the appearance/appearance-changed event.
  • EdenCSS: every color token now has light and dark values through light-dark(). Hard-coded rgba tints in components are now color-mix() of tokens. Shadows have lighter light-mode values.
  • Apps: Settings, Files, File Picker, Installer, Editor and the hello example now read correctly in light themes.
  • Changed default: Eden no longer follows the OS light/dark setting. It uses the default theme until the user chooses one.
  • Dev host: the pink palette is now a sample dev-pink theme instead of a separate token file.

Docs: new docs/themes.md.

Testing

  • New tests: unit tests for the Appearance service. Integration tests for choosing a theme in Settings, restoring it after a restart, and theme or wallpaper settings written directly to the settings store. A view-rendering test checks that the theme stylesheet goes after Eden CSS and is replaced on a theme change and on reload.
  • SDK unit and integration suites: pass except four volume/DLC tests that also fail on main.
  • Settings vitest: 22/22. Type checks, lint, codegen and the build are clean.
  • Manual check: in the Electron app, switched Eden Dark → Eden Light → the pink theme.

🤖 Generated with Claude Code

Users pick a theme in Settings > Appearance. Each theme is light or dark
and sets Electron's color scheme, the theme colors, and the wallpaper
variant. Consumers add themes and set the default with `appearance` in
createEden, and change the theme through eden.appearance.
- Reject theme values that could break the stylesheet: quotes, url(),
  !important, and unbalanced parentheses. Colors set to undefined use the
  inherited color.
- Replace a view's theme stylesheet when Eden CSS is injected again,
  instead of tracking navigation starts that may not replace the page.
- Apply appearance settings only from committed writes, and use the
  default for an unconfigured theme, as at startup.
- Update the main window background when the theme changes, and pass it
  only colors Electron reads the same way as CSS.
- Calculator operators, Files pin colors, warning contrast and the on-screen
  keyboard now read correctly in light themes.
- Foundation no longer flashes a dark wallpaper before the stored one loads.
- Replace references to undefined color tokens.
- Primary actions use accent-primary so themes can recolor them.
- Settings refreshes the Appearance panel when the theme or wallpaper changes.
- Theme values must be a single CSS color.
- Theme previews use their own color scheme.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant