Skip to content

Commit d375e31

Browse files
committed
feat(markup): update search match styles
1 parent 0285ba2 commit d375e31

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

src/markup/codemirror/search-plugin/plugin.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@ import {
1919
keymap,
2020
} from '@codemirror/view';
2121

22+
import type {MarkdownEditorMode} from 'src/bundle';
23+
import type {EventMap} from 'src/bundle/Editor';
24+
import type {RendererItem} from 'src/extensions';
25+
import {debounce} from 'src/lodash';
2226
import {renderSearchPopup} from 'src/search';
27+
import type {Receiver} from 'src/utils';
2328

24-
import type {MarkdownEditorMode} from '../../../bundle';
25-
import type {EventMap} from '../../../bundle/Editor';
26-
import type {RendererItem} from '../../../extensions';
27-
import {debounce} from '../../../lodash';
28-
import type {Receiver} from '../../../utils';
2929
import {ReactRendererFacet} from '../react-facet';
3030

31-
import {renderSearchPopup} from './view/SearchPopup';
31+
import {searchTheme} from './theme';
3232

3333
type SearchQueryConfig = ConstructorParameters<typeof SearchQuery>[0];
3434

@@ -167,6 +167,7 @@ export const SearchPanelPlugin = (params: SearchPanelPluginParams) =>
167167
{
168168
provide: () => [
169169
keymap.of(searchKeymap),
170+
searchTheme,
170171
search({
171172
createPanel: () => ({
172173
// Create an empty search panel
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import {EditorView} from '#cm/view';
2+
3+
export const searchTheme = EditorView.baseTheme({
4+
'&light, &dark': {
5+
'& .cm-searchMatch': {
6+
backgroundColor: 'var(--g-color-base-info-light)',
7+
},
8+
'& .cm-searchMatch-selected': {
9+
backgroundColor: 'var(--g-color-base-info-heavy)',
10+
},
11+
},
12+
});

0 commit comments

Comments
 (0)