feat: add color scheme customization#2263
Open
kantord wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds operator-configurable color scheme branding so the Electron main process can load a JSON theme, serialize allowed color tokens to CSS, and expose it to the renderer before React mounts.
Changes:
- Adds branding config schema, token sanitization/serialization utilities, loader, and tests.
- Passes generated branding CSS from main to preload via
additionalArguments, then injects it in the renderer. - Adds a sample test theme, documentation, and a dev launch script for custom-theme verification.
Reviewed changes
Copilot reviewed 49 out of 49 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
common/branding/color-tokens.ts |
Defines allowed color tokens and serializes safe overrides to CSS. |
common/branding/__tests__/color-tokens.test.ts |
Tests token filtering, sanitization, and CSS output. |
common/branding/schema.ts |
Defines the branding JSON schema. |
main/src/branding/load.ts |
Loads branding config and converts color tokens to CSS. |
main/src/branding/__tests__/load.test.ts |
Tests config loading, invalid inputs, and CSS generation. |
main/src/branding/paths.ts |
Resolves the branding config path. |
main/src/main-window.ts |
Loads branding CSS and passes it to the renderer process. |
preload/src/api/branding.ts |
Reads and decodes branding CSS from process arguments. |
preload/src/api/__tests__/branding.test.ts |
Tests preload branding argument handling. |
preload/src/preload.ts |
Exposes the branding API through electronAPI. |
renderer/src/renderer.tsx |
Injects branding CSS before mounting React. |
renderer/src/index.css |
Adds additional themeable color variables. |
renderer/src/common/mocks/electronAPI.ts |
Adds branding to the renderer test Electron API mock. |
vitest.setup.ts |
Adds branding to the global Electron API test stub. |
branding-examples/README.md |
Documents branding examples and usage. |
branding-examples/test-theme.json |
Adds a sample custom color theme. |
scripts/start-custom-theme.ts |
Adds a helper for launching with the sample theme. |
package.json |
Adds the start:customTheme script. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.