Zed Editor · · 2 min read

User themes now in Preview

Mirrored from Zed Editor for archival readability. Support the source by reading on the original site.

Today we're excited to share that you can now bring your own theme to Zed Preview!

Adding a theme

Themes are stored in the themes/ subdirectory under the Zed config:

~/.config/zed/themes

Each theme file can contain multiple themes—such as light and dark variants—under the same theme family.

The basic structure of a theme file looks like this:

// ~/.config/zed/themes/my-cool-theme.json
{
  "$schema": "https://zed.dev/schema/themes/v0.2.0.json",
  "name": "My Cool Theme",
  "author": "You!",
  "themes": [
    {
      "name": "My Cool Dark Theme",
      "appearance": "dark",
      "style": {
        "editor.background": "#000"
        // ...
      }
    },
    {
      "name": "My Cool Light Theme",
      "appearance": "light",
      "style": {
        "editor.background": "#fff"
        // ...
      }
    }
  ]
}

Add a theme file to the themes directory and it will be available in the theme selector the next time Zed loads.

In the near future we'll make it so Zed can automatically detect changes in the themes directory.

Modifying an existing theme

In addition to bringing your entire theme, you can also override values in the active theme via the Zed settings:

// ~/.config/zed/settings.json
{
  "theme": "One Dark",
  "experimental.theme_overrides": {
    "editor.background": "#333"
  }
}

Changes set in experimental.theme_overrides apply to every theme.

Additionally, Zed will live-reload when this setting is changed, making it a great way to iterate quickly while building a theme.

Using a VS Code theme

If you are looking to use an existing VS Code theme in Zed, we have a work-in-progress theme importer available in the Zed repo.

Note that you'll need to have the Zed development toolchain setup locally in order to use the theme importer.

You can run it against a VS Code theme file and it will output a Zed theme based on it:

cargo run -p theme_importer -- ~/Downloads/vitesse-dark-soft.json

While the resulting theme will likely not be perfect, this can be a good starting point if you're looking to bring over a theme from VS Code.

Go forth and theme!

Themes are still in the early stages, but we hope you enjoy this first taste. As always, feedback and suggestions are welcome on our GitHub.

Tweet @zeddotdev to show us your fresh new looks for Zed.

We can't wait to see all your new themes!



Related Posts

Check out similar blogs from the Zed team.


Looking for a better editor?

You can try Zed today on macOS, Windows, or Linux. Download now!


We are hiring!

If you're passionate about the topics we cover on our blog, please consider joining our team to help us ship the future of software development.

Discussion (0)

Sign in to join the discussion. Free account, 30 seconds — email code or GitHub.

Sign in →

No comments yet. Sign in and be the first to say something.

More from Zed Editor