Skip to content

Commit 5b17808

Browse files
committed
Support for solarized dark and light themes
CodeMirror seems to have the two solarized themes within the `node_modules/coemirror/theme/solarized.css`. So passing the string "solarized light" and "solarized dark" to the editor theme appropriately sets these themes. The Boostnote app appears to be dynamically determining themes based on the css files found within `node_modules/codemirror/theme/`. So that's why there was just a single option of 'solarized' before. The light and dark 'solarized' themes appear to be the *only* themes that share a css style, whereas all other light and dark variarnt themes get their own css file (ex: base16-dark.css and base16-light.css). Weird!
1 parent c39e5c6 commit 5b17808

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

browser/lib/consts.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const themes = fs.readdirSync(themePath)
1010
.map((themePath) => {
1111
return themePath.substring(0, themePath.lastIndexOf('.'))
1212
})
13+
themes.splice(themes.indexOf('solarized'), 1, 'solarized dark', 'solarized light')
1314

1415
const consts = {
1516
FOLDER_COLORS: [

browser/main/modals/PreferencesModal/UiTab.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class UiTab extends React.Component {
6161
const newCodemirrorTheme = this.refs.editorTheme.value
6262

6363
if (newCodemirrorTheme !== codemirrorTheme) {
64-
checkHighLight.setAttribute('href', `../node_modules/codemirror/theme/${newCodemirrorTheme}.css`)
64+
checkHighLight.setAttribute('href', `../node_modules/codemirror/theme/${newCodemirrorTheme.split(" ")[0]}.css`)
6565
}
6666

6767
this.setState({ config: newConfig, codemirrorTheme: newCodemirrorTheme })

0 commit comments

Comments
 (0)