Automatically switch Obsidian themes based on the folder of the opened note.
obsidian-theme-by-folder.mov
- Auto Theme & Mode Switching: Instantly changes your Obsidian theme and mode (light/dark) when you open a note in a configured folder.
- Per-Folder Configuration: Assign custom themes and modes to specific vault folders.
- Flexible Mode Options: Choose between Light Mode, Dark Mode, or System Default for each folder.
- Fallback Settings: Define default theme and mode to use when no folder mapping matches.
- Lightweight & Fast: Minimal performance impact with simple path-based matching.
- User-Friendly UI: Configure mappings directly in Obsidian's Settings → Theme by Folder.
- Download or clone this repository into your vault's plugins folder:
git clone https://github.com/JinmuGo/obsidian-theme-by-folder .obsidian/plugins/theme-by-folder
- In Obsidian, go to Settings → Community Plugins and enable Theme by Folder.
- Reload Obsidian if the plugin doesn't appear immediately.
You can use BRAT (Beta Reviewer's Auto-update Tool) to install this plugin before it becomes publicly listed:
- Install the BRAT plugin from Obsidian's Community Plugins.
- Go to
BRATsettings → Click "Add a beta plugin". - Paste the following GitHub repo URL: https://github.com/JinmuGo/obsidian-theme-by-folder
- Click Install and Enable the plugin!
- Open Settings → Theme by Folder.
- Click Add Mapping to create a new mapping.
- Enter a Mapping Name, choose or type the Folder Path, select a Theme from the dropdown, and choose a Mode (Light/Dark/System).
- Repeat for additional folders as needed.
- (Optional) Set Default Theme and Default Mode for unmatched folders.
Once configured, simply open any note in your vault. The plugin will detect the note's folder and automatically apply the corresponding theme and mode. If no mapping is found, the Default Theme and Mode are used.
obsidian-theme-by-folder/
├── src/
│ ├── main.ts # Core plugin logic
│ ├── settings.ts # Types and default settings
│ ├── ui/ # UI components and renderers
│ └── utils/ # Utility functions
├── manifest.json # Plugin manifest
├── package.json # NPM package info
└── tsconfig.json # TypeScript config
pnpm install
pnpm buildContributions, issues, and feature requests are welcome! Please check out the issues page or open a pull request
This project is licensed under the 0BSD License. See LICENSE for details.