@uiw/codemirror-themes
Advanced tools
Comparing version 4.19.6 to 4.19.7
@@ -18,5 +18,5 @@ import { Extension } from '@codemirror/state'; | ||
/** Editor background. */ | ||
background: string; | ||
background?: string; | ||
/** Default text color. */ | ||
foreground: string; | ||
foreground?: string; | ||
/** Caret color. */ | ||
@@ -23,0 +23,0 @@ caret?: string; |
@@ -11,11 +11,19 @@ "use strict"; | ||
var theme = _ref.theme, | ||
settings = _ref.settings, | ||
styles = _ref.styles; | ||
_ref$settings = _ref.settings, | ||
settings = _ref$settings === void 0 ? {} : _ref$settings, | ||
_ref$styles = _ref.styles, | ||
styles = _ref$styles === void 0 ? [] : _ref$styles; | ||
var themeOptions = { | ||
'&': { | ||
backgroundColor: settings.background, | ||
color: settings.foreground | ||
}, | ||
'.cm-gutters': {} | ||
}; | ||
var baseStyle = {}; | ||
if (settings.background) { | ||
baseStyle.backgroundColor = settings.background; | ||
} | ||
if (settings.foreground) { | ||
baseStyle.color = settings.foreground; | ||
} | ||
if (settings.background || settings.foreground) { | ||
themeOptions['&'] = baseStyle; | ||
} | ||
if (settings.fontFamily) { | ||
@@ -22,0 +30,0 @@ themeOptions['&.cm-editor .cm-scroller'] = { |
@@ -18,5 +18,5 @@ import { Extension } from '@codemirror/state'; | ||
/** Editor background. */ | ||
background: string; | ||
background?: string; | ||
/** Default text color. */ | ||
foreground: string; | ||
foreground?: string; | ||
/** Caret color. */ | ||
@@ -23,0 +23,0 @@ caret?: string; |
@@ -6,12 +6,18 @@ import { EditorView } from '@codemirror/view'; | ||
theme, | ||
settings, | ||
styles | ||
settings = {}, | ||
styles = [] | ||
} = _ref; | ||
var themeOptions = { | ||
'&': { | ||
backgroundColor: settings.background, | ||
color: settings.foreground | ||
}, | ||
'.cm-gutters': {} | ||
}; | ||
var baseStyle = {}; | ||
if (settings.background) { | ||
baseStyle.backgroundColor = settings.background; | ||
} | ||
if (settings.foreground) { | ||
baseStyle.color = settings.foreground; | ||
} | ||
if (settings.background || settings.foreground) { | ||
themeOptions['&'] = baseStyle; | ||
} | ||
if (settings.fontFamily) { | ||
@@ -18,0 +24,0 @@ themeOptions['&.cm-editor .cm-scroller'] = { |
{ | ||
"name": "@uiw/codemirror-themes", | ||
"version": "4.19.6", | ||
"version": "4.19.7", | ||
"description": "Themes for CodeMirror.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://uiwjs.github.io/react-codemirror/#/theme/doc", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
37597
341