()
| 816 | } |
| 817 | |
| 818 | const createTheme = async (): Promise<void> => { |
| 819 | const name = await promptApp({ |
| 820 | title: 'New theme', |
| 821 | description: 'Creates a folder with a manifest.json and theme.css you can edit.', |
| 822 | placeholder: 'My Theme', |
| 823 | initialValue: 'My Theme', |
| 824 | okLabel: 'Create' |
| 825 | }) |
| 826 | if (name === null) return |
| 827 | const slug = await window.zen.createCustomTheme?.({ name: name.trim() || 'My Theme' }) |
| 828 | if (slug) { |
| 829 | refreshCustomThemes() |
| 830 | void window.zen.revealCustomThemesDir?.(slug) |
| 831 | } |
| 832 | } |
| 833 | |
| 834 | // Keep the swatches showing the *active theme's* colors: re-read each token |
| 835 | // whenever the applied theme changes (data-theme / data-theme-mode flip on |
no test coverage detected