1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +00:00

check solarized theme or not beofre setting css

solarized dark/light shares the solarized.css
This commit is contained in:
yosmoc
2017-11-09 23:10:02 +01:00
parent 2459a80e15
commit cb298b8cad
2 changed files with 13 additions and 3 deletions

View File

@@ -258,7 +258,9 @@ export default class MarkdownPreview extends React.Component {
theme = consts.THEMES.some((_theme) => _theme === theme) && theme !== 'default'
? theme
: 'elegant'
this.getWindow().document.getElementById('codeTheme').href = `${appPath}/node_modules/codemirror/theme/${theme.split(' ')[0]}.css`
this.getWindow().document.getElementById('codeTheme').href = theme.startsWith('solarized')
? `${appPath}/node_modules/codemirror/theme/${theme.split(' ')[0]}.css`
: `${appPath}/node_modules/codemirror/theme/${theme}.css`
}
rewriteIframe () {