Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit 0cfa6d9

Browse files
committed
feat(theme): search hightlight in doramon shell
1 parent bdf181b commit 0cfa6d9

File tree

10 files changed

+42
-4
lines changed

10 files changed

+42
-4
lines changed

containers/Doraemon/ResultsList.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const ResultsList = ({ searchValue, searchThread, suggestions, activeRaw }) => (
5050
<ContentWraper>
5151
<Title>
5252
<Highlighter
53-
highlightClassName="YourHighlightClass"
53+
highlightClassName="doramon-search-highlighter"
5454
searchWords={[searchValue]}
5555
autoEscape
5656
textToHighlight={suggestion.title}

containers/ThemeWrapper/GlobalStyle.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const GlobalStyle = createGlobalStyle`
1818
body {
1919
${cs.media.mobile`
2020
position: relative;
21-
`};
21+
`};
2222
}
2323
*::-moz-selection {
2424
background-color: ${theme('selectionBg')} !important;
@@ -132,6 +132,12 @@ const GlobalStyle = createGlobalStyle`
132132
text-decoration: underline;
133133
}
134134
}
135+
136+
.doramon-search-highlighter {
137+
background-color: ${theme('searchHighlight.doramonBg')};
138+
padding: 0 1px;
139+
color: ${theme('searchHighlight.doramonFg')};
140+
}
135141
`
136142

137143
export default GlobalStyle

utils/themes/skins/cyan.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,10 @@ const cyan = {
313313
border: '#e8e8e8',
314314
hoverBg: '#fffef1',
315315
},
316+
searchHighlight: {
317+
doramonFg: '#F6DE38',
318+
doramonBg: 'transparent',
319+
},
316320
}
317321

318322
export default cyan

utils/themes/skins/github.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,10 @@ const github = {
314314
border: '#004657',
315315
hoverBg: '#285769',
316316
},
317+
searchHighlight: {
318+
doramonFg: 'orange',
319+
doramonBg: 'transparent',
320+
},
317321
}
318322

319323
export default github

utils/themes/skins/green.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,10 @@ const green = {
304304
border: '#004657',
305305
hoverBg: '#285769',
306306
},
307+
searchHighlight: {
308+
doramonFg: 'orange',
309+
doramonBg: 'transparent',
310+
},
307311
}
308312

309313
export default green

utils/themes/skins/iron_green.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,10 @@ const iconGreen = {
307307
border: '#004657',
308308
hoverBg: '#285769',
309309
},
310+
searchHighlight: {
311+
doramonFg: 'orange',
312+
doramonBg: 'transparent',
313+
},
310314
}
311315

312316
export default iconGreen

utils/themes/skins/monokai.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,10 @@ const monokai = {
308308
border: '#004657',
309309
hoverBg: '#285769',
310310
},
311+
searchHighlight: {
312+
doramonFg: 'orange',
313+
doramonBg: 'transparent',
314+
},
311315
}
312316

313317
export default monokai

utils/themes/skins/purple.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,10 @@ const purple = {
312312
border: '#004657',
313313
hoverBg: '#285769',
314314
},
315+
searchHighlight: {
316+
doramonFg: 'orange',
317+
doramonBg: 'transparent',
318+
},
315319
}
316320

317321
export default purple

utils/themes/skins/solarized_dark.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,11 @@ const solarizedDark = {
228228
},
229229
shell: {
230230
link: lighten(0.2, contentBg),
231-
searchInput: lighten(0.1, contentBg),
231+
searchInput: lighten(0.2, contentBg),
232232
searchIcon: lighten(0.1, contentBg),
233233
barBg: darken(0.01, contentBg),
234234
border: lighten(0.05, contentBg),
235-
title: lighten(0.4, contentBg),
235+
title: lighten(0.3, contentBg),
236236
desc: lighten(0.2, contentBg),
237237
activeBg: lighten(0.05, contentBg),
238238
},
@@ -313,6 +313,10 @@ const solarizedDark = {
313313
border: '#004657',
314314
hoverBg: '#285769',
315315
},
316+
searchHighlight: {
317+
doramonFg: 'orange',
318+
doramonBg: 'transparent',
319+
},
316320
}
317321

318322
export default solarizedDark

utils/themes/skins/yellow.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,10 @@ const yellow = {
311311
border: '#004657',
312312
hoverBg: '#285769',
313313
},
314+
searchHighlight: {
315+
doramonFg: 'orange',
316+
doramonBg: 'transparent',
317+
},
314318
}
315319

316320
export default yellow

0 commit comments

Comments
 (0)