@uiw/codemirror-themes
Advanced tools
Comparing version 4.12.4 to 4.13.0
@@ -7,11 +7,8 @@ "use strict"; | ||
exports["default"] = exports.createTheme = void 0; | ||
var _view = require("@codemirror/view"); | ||
var _language = require("@codemirror/language"); | ||
var createTheme = function createTheme(_ref) { | ||
var theme = _ref.theme, | ||
settings = _ref.settings, | ||
styles = _ref.styles; | ||
settings = _ref.settings, | ||
styles = _ref.styles; | ||
var themeOptions = { | ||
@@ -24,15 +21,11 @@ '&': { | ||
}; | ||
if (settings.gutterBackground) { | ||
themeOptions['.cm-gutters'].backgroundColor = settings.gutterBackground; | ||
} | ||
if (settings.gutterForeground) { | ||
themeOptions['.cm-gutters'].color = settings.gutterForeground; | ||
} | ||
if (settings.gutterBorder) { | ||
themeOptions['.cm-gutters'].borderRightColor = settings.gutterBorder; | ||
} | ||
if (settings.caret) { | ||
@@ -46,3 +39,2 @@ themeOptions['.cm-content'] = { | ||
} | ||
if (settings.lineHighlight) { | ||
@@ -56,3 +48,2 @@ themeOptions['.cm-activeLine'] = { | ||
} | ||
if (settings.selection) { | ||
@@ -63,3 +54,2 @@ themeOptions['&.cm-focused .cm-selectionBackground .cm-selectionBackground, & .cm-selectionLayer .cm-selectionBackground, ::selection'] = { | ||
} | ||
if (settings.selectionMatch) { | ||
@@ -70,13 +60,9 @@ themeOptions['& .cm-selectionMatch'] = { | ||
} | ||
var themeExtension = _view.EditorView.theme(themeOptions, { | ||
dark: theme === 'dark' | ||
}); | ||
var highlightStyle = _language.HighlightStyle.define(styles); | ||
var extension = [themeExtension, (0, _language.syntaxHighlighting)(highlightStyle)]; | ||
return extension; | ||
}; | ||
exports.createTheme = createTheme; | ||
@@ -83,0 +69,0 @@ var _default = createTheme; |
@@ -16,15 +16,11 @@ import { EditorView } from '@codemirror/view'; | ||
}; | ||
if (settings.gutterBackground) { | ||
themeOptions['.cm-gutters'].backgroundColor = settings.gutterBackground; | ||
} | ||
if (settings.gutterForeground) { | ||
themeOptions['.cm-gutters'].color = settings.gutterForeground; | ||
} | ||
if (settings.gutterBorder) { | ||
themeOptions['.cm-gutters'].borderRightColor = settings.gutterBorder; | ||
} | ||
if (settings.caret) { | ||
@@ -38,3 +34,2 @@ themeOptions['.cm-content'] = { | ||
} | ||
if (settings.lineHighlight) { | ||
@@ -48,3 +43,2 @@ themeOptions['.cm-activeLine'] = { | ||
} | ||
if (settings.selection) { | ||
@@ -55,3 +49,2 @@ themeOptions['&.cm-focused .cm-selectionBackground .cm-selectionBackground, & .cm-selectionLayer .cm-selectionBackground, ::selection'] = { | ||
} | ||
if (settings.selectionMatch) { | ||
@@ -62,3 +55,2 @@ themeOptions['& .cm-selectionMatch'] = { | ||
} | ||
var themeExtension = EditorView.theme(themeOptions, { | ||
@@ -65,0 +57,0 @@ dark: theme === 'dark' |
{ | ||
"name": "@uiw/codemirror-themes", | ||
"version": "4.12.4", | ||
"version": "4.13.0", | ||
"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
29638