Marp Theme (VS Code / Cursor)
Manage standalone Marp theme CSS and pick which theme preview/export use.
How it works with Marp
Marp for VS Code ignores absolute / file:// theme paths outside the workspace (see normalizePaths in marp-vscode). This extension therefore:
- Serves standalone CSS from a local
http://127.0.0.1:<port>/… server
- Registers those http URLs into
markdown.marp.themes (Global + Workspace)
After install: Reload Window, then Marp Theme: Refresh Theme List (or Select Active Theme).
Install
cd extension
npm run package
# Install the generated .vsix:
# Cursor/VS Code → Extensions → … → Install from VSIX
Or: cursor --install-extension marp-theme-0.1.0.vsix
Themes folders
| Location |
Role |
extension/themes/ |
Bundled (usyd-ochre, usyd-black) |
Global storage …/marp-theme/themes/ |
Imported via command |
Workspace themes/ |
Auto-scanned if present |
marpTheme.themesFolders |
Extra absolute paths in settings |
Only standalone CSS is accepted: must start with /* @theme name */ and must not use local url(./…) / url(../…). Embed fonts/images as data: URIs.
Select Active Theme
| 选项 |
效果 |
| (none) |
activeTheme 为空,去掉文档里的 theme: |
| default |
Marp 内置 theme: default |
| 其它 |
自定义 standalone @theme |
Settings → Marp Theme: Imported Themes:列表显示已导入主题;从列表删掉一项即删除对应文件。也可用命令 Delete Imported Theme…。
| Setting |
Meaning |
marpTheme.activeTheme |
@theme name for apply / new slides |
marpTheme.autoApply |
Fill missing theme: on open; sync on active-theme change |
marpTheme.themesFolders |
Extra theme directories |
marpTheme.registerWithMarp |
Write paths into markdown.marp.themes |
Commands
- Marp Theme: Select Active Theme… — pick theme, apply to current Marp doc
- Marp Theme: Apply Active Theme to Document
- Marp Theme: Import Standalone CSS…
- Marp Theme: Refresh Theme List
- Marp Theme: Open Themes Folder
- Marp Theme: New Slide Deck
Usage
- Install extension (+ Marp).
- Command Palette → Select Active Theme →
usyd-ochre or usyd-black.
- Open Markdown preview (Marp). Export via Marp’s export command — frontmatter
theme: must match a registered theme.
---
marp: true
theme: usyd-ochre
---
| |