Store the theme for shared notes

This commit is contained in:
Alan Grainger 2023-10-16 13:20:18 +02:00
parent de2491bc1b
commit f69922bb8b
2 changed files with 9 additions and 5 deletions

View file

@ -386,11 +386,8 @@ export default class Note {
// Store the CSS theme in the settings
// @ts-ignore - customCss is not exposed
const theme = this.plugin.app?.customCss?.theme
if (theme) {
this.plugin.settings.theme = theme
await this.plugin.saveSettings()
}
this.plugin.settings.theme = this.plugin.app?.customCss?.theme || ''
await this.plugin.saveSettings()
} catch (e) { }
}
}

View file

@ -102,6 +102,13 @@ export class ShareSettingsTab extends PluginSettingTab {
.setName('Upload options')
.setHeading()
new Setting(containerEl)
.setName('Theme')
.setDesc('This is the theme used for your shared notes. To set a new theme, change the theme in Obsidian to your desired theme, then use the `Force re-upload all data` command. You can change your Obsidian theme after that without affecting the theme for your shared notes.')
.addText(text => text
.setValue(this.plugin.settings.theme || 'Default theme')
.setDisabled(true))
// Choose light/dark theme mode
new Setting(containerEl)
.setName('Light/Dark mode')