@uiw/codemirror-themes
Advanced tools
Comparing version 4.9.3 to 4.9.4
@@ -25,2 +25,4 @@ import { Extension } from '@codemirror/state'; | ||
selection: string; | ||
/** Selection match background. */ | ||
selectionMatch?: string; | ||
/** Background of highlighted lines. */ | ||
@@ -27,0 +29,0 @@ lineHighlight: string; |
@@ -16,4 +16,3 @@ "use strict"; | ||
styles = _ref.styles; | ||
var themeExtension = _view.EditorView.theme({ | ||
var themeOptions = { | ||
'&': { | ||
@@ -29,5 +28,2 @@ backgroundColor: settings.background, | ||
}, | ||
'&.cm-focused .cm-selectionBackground .cm-selectionBackground, & .cm-selectionLayer .cm-selectionBackground, ::selection': { | ||
backgroundColor: settings.selection | ||
}, | ||
'.cm-activeLine': { | ||
@@ -43,3 +39,17 @@ backgroundColor: settings.lineHighlight | ||
} | ||
}, { | ||
}; | ||
if (settings.selection) { | ||
themeOptions['&.cm-focused .cm-selectionBackground .cm-selectionBackground, & .cm-selectionLayer .cm-selectionBackground, ::selection'] = { | ||
backgroundColor: settings.selection | ||
}; | ||
} | ||
if (settings.selectionMatch) { | ||
themeOptions['& .cm-selectionMatch'] = { | ||
backgroundColor: settings.selectionMatch | ||
}; | ||
} | ||
var themeExtension = _view.EditorView.theme(themeOptions, { | ||
dark: theme === 'dark' | ||
@@ -46,0 +56,0 @@ }); |
@@ -25,2 +25,4 @@ import { Extension } from '@codemirror/state'; | ||
selection: string; | ||
/** Selection match background. */ | ||
selectionMatch?: string; | ||
/** Background of highlighted lines. */ | ||
@@ -27,0 +29,0 @@ lineHighlight: string; |
@@ -9,3 +9,3 @@ import { EditorView } from '@codemirror/view'; | ||
} = _ref; | ||
var themeExtension = EditorView.theme({ | ||
var themeOptions = { | ||
'&': { | ||
@@ -21,5 +21,2 @@ backgroundColor: settings.background, | ||
}, | ||
'&.cm-focused .cm-selectionBackground .cm-selectionBackground, & .cm-selectionLayer .cm-selectionBackground, ::selection': { | ||
backgroundColor: settings.selection | ||
}, | ||
'.cm-activeLine': { | ||
@@ -35,3 +32,17 @@ backgroundColor: settings.lineHighlight | ||
} | ||
}, { | ||
}; | ||
if (settings.selection) { | ||
themeOptions['&.cm-focused .cm-selectionBackground .cm-selectionBackground, & .cm-selectionLayer .cm-selectionBackground, ::selection'] = { | ||
backgroundColor: settings.selection | ||
}; | ||
} | ||
if (settings.selectionMatch) { | ||
themeOptions['& .cm-selectionMatch'] = { | ||
backgroundColor: settings.selectionMatch | ||
}; | ||
} | ||
var themeExtension = EditorView.theme(themeOptions, { | ||
dark: theme === 'dark' | ||
@@ -38,0 +49,0 @@ }); |
{ | ||
"name": "@uiw/codemirror-themes", | ||
"version": "4.9.3", | ||
"version": "4.9.4", | ||
"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
22286
249