Add experimental.theme_overrides to settings file (#6791)

This PR adds **experimental** support for overriding theme values in the
current theme.

Be advised that both the existence of this setting and the structure of
the theme itself are subject to change.

But this is a first step towards allowing Zed users to customize or
bring their own themes.

### How it works

There is a new `experimental.theme_overrides` setting in
`settings.json`.

This accepts an object containing overrides for values in the theme. All
values are optional, and will be overlaid on top of whatever theme you
currently have set by the `theme` field.

There is JSON schema support to show which values are supported.

### Example

Here's an example of it in action:


https://github.com/zed-industries/zed/assets/1486634/173b94b1-4d88-4333-b980-8fed937e6f6d

Release Notes:

- Added `experimental.theme_overrides` to `settings.json` to allow for
customizing the current theme.
  - This setting is experimental and subject to change.
This commit is contained in:
Marshall Bowers 2024-01-26 13:42:58 -05:00 committed by GitHub
parent c9c9a6b11b
commit f5f7be1500
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 1182 additions and 3 deletions

View file

@ -159,6 +159,7 @@ impl ThemeSelectorDelegate {
cx.update_global(|store: &mut SettingsStore, cx| {
let mut theme_settings = store.get::<ThemeSettings>(None).clone();
theme_settings.active_theme = theme;
theme_settings.apply_theme_overrides();
store.override_global(theme_settings);
cx.refresh();
});