Skip to content

Commit 48b5fb2

Browse files
committed
feat(markup): update search match styles
1 parent 0f105b2 commit 48b5fb2

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,17 @@ 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/modules/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 {searchTheme} from './theme';
32+
3133
type SearchQueryConfig = ConstructorParameters<typeof SearchQuery>[0];
3234

3335
const INPUT_DELAY = 200;
@@ -165,6 +167,7 @@ export const SearchPanelPlugin = (params: SearchPanelPluginParams) =>
165167
{
166168
provide: () => [
167169
keymap.of(searchKeymap),
170+
searchTheme,
168171
search({
169172
createPanel: () => ({
170173
// 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)