From c560a24e7d817c19d0157ae0f5b55e48815fdf47 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Thu, 27 Jun 2024 22:06:22 -0600 Subject: [PATCH] Default theme to match system (#13621) Release Notes: - Default to a light theme during the day (#9627) --- assets/settings/default.json | 16 ++++++---------- assets/settings/initial_user_settings.json | 7 ++++++- docs/src/themes.md | 20 +++++++++----------- 3 files changed, 21 insertions(+), 22 deletions(-) diff --git a/assets/settings/default.json b/assets/settings/default.json index 44c0200550..0b389cf1fe 100644 --- a/assets/settings/default.json +++ b/assets/settings/default.json @@ -1,19 +1,15 @@ { // The name of the Zed theme to use for the UI. // - // The theme can also be set to follow system preferences: - // - // "theme": { - // "mode": "system", - // "light": "One Light", - // "dark": "One Dark" - // } - // - // Where `mode` is one of: + // `mode` is one of: // - "system": Use the theme that corresponds to the system's appearance // - "light": Use the theme indicated by the "light" field // - "dark": Use the theme indicated by the "dark" field - "theme": "One Dark", + "theme": { + "mode": "system", + "light": "One Light", + "dark": "One Dark", + }, // The name of a base set of key bindings to use. // This setting can take four values, each named after another // text editor: diff --git a/assets/settings/initial_user_settings.json b/assets/settings/initial_user_settings.json index 75d4a02626..7dd03c2781 100644 --- a/assets/settings/initial_user_settings.json +++ b/assets/settings/initial_user_settings.json @@ -8,5 +8,10 @@ // from the command palette or from `Zed` application menu. { "ui_font_size": 16, - "buffer_font_size": 16 + "buffer_font_size": 16, + "theme": { + "mode": "system", + "light": "One Light", + "dark": "One Dark", + }, } diff --git a/docs/src/themes.md b/docs/src/themes.md index 0fdcd5896c..c77650a3f3 100644 --- a/docs/src/themes.md +++ b/docs/src/themes.md @@ -2,21 +2,19 @@ Zed comes with a number of built-in themes, with more themes available as extensions. -## Choosing a Theme +## Selecting a Theme -You can choose a theme in Zed a few ways: +You can see what these are installed and preview them from the Theme Selector. You can open the Theme Selector from the command palette with "theme selector: Toggle" (bound to `cmd-k cmd-t` on macOS and `ctrl-k ctrl-t` on Linux). Selecting a theme by moving up and down will change the theme in real time and hitting enter will save it to your settings file. -- by pressing `CMD + K` then `CMD + T` -- by typing `theme` in the command palette -- by editing your `settings.json` with a specific theme name: +## Installing more Themes -```json -{ - "theme": "Ayu Mirage" -} -``` +More themes are available from the Extensions page. You can open the Extensions page from the command palette with "zed: Extensions". Many popular themes have been ported to Zed, and if you're struggling to choose one, there's a third-party gallery hosted by https://zed-themes.com with visible previews for many of them. -You can also use different themes based on system preferences: +## Configuring a Theme + +Your selected theme is stored in your settings file. You can open your settings file from the command palette with "zed: Open Settings" (bound to `cmd,` on macOS and `ctrl,` on Linux). + +By default, Zed maintains two themes: one for light mode and one for dark mode. You can set the mode to `"dark"` or `"light"` to ignore the current system mode. ```json {