In this tutorial, you'll learn how to start developing a theme for Obsidian. Themes let you customize how Obsidian looks and feels, using CSS.

What you'll learn

After you've completed this tutorial, you'll be able to:

  • Configure an environment for developing Obsidian themes.
  • Use CSS variables to change how Obsidian looks.
  • Create a theme that supports both light and dark color schemes.

Prerequisites

To complete this tutorial, you'll need:

Step 1: Download the sample theme

In this step, you'll download a sample theme to the themes directory in your vault's .obsidian directory so that Obsidian can find it.

The sample theme you'll use in this tutorial is available in a GitHub repository.

  1. Open a terminal window and change the project directory to the themes directory.

    cd path/to/vault/.obsidian/themes
    
  2. Clone the sample theme using Git.

    git clone https://github.com/obsidianmd/obsidian-sample-theme.git "Sample Theme"
    
GitHub template repository

The repository for the sample theme is a GitHub template repository, which means you can create your own repository from the sample theme. To learn how, refer to Creating a repository from a template.

Remember to use the URL to your own repository when cloning the sample theme.

Step 2: Enable the theme

  1. In Obsidian, open Settings.
  2. In the side menu, select Appearance.
  3. Next to Themes, select Sample Theme from the dropdown list.

You've enabled the sample theme. Next, we'll make some changes to it.

Step 3: Update the manifest

In this step, you'll rename the theme by updating the manifest, manifest.json. The manifest contains information about your theme, such as its name and description.

  1. Open manifest.json in your code editor.

  2. Change name to a human-friendly name, such as "Disco Lights".

  3. Rename the theme directory under themes to the same name. The name of the theme directory must exactly match the name property in manifest.json.

    mv "Sample Theme" "Disco Lights"
    
  4. Restart Obsidian to load the new changes to the manifest.

Go back to Settings → Appearance → Themes and notice that the name of the theme has been changed.

Remember to restart Obsidian whenever you make changes to manifest.json.

Build a theme
Interactive graph