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

Commit 5b91a2e

Browse files
committed
fix searchbar css
1 parent 1affd42 commit 5b91a2e

3 files changed

Lines changed: 25 additions & 7 deletions

File tree

app/renderer/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ function createWebView() {
110110
window: webview,
111111
showInspectElement: true,
112112
append(props) {
113-
const hasText = props.selectionText.trim().length > 0
113+
const hasText = props.selectionText && props.selectionText.trim().length > 0
114114
return [
115115
{
116116
id: 'searchGoogle',

app/renderer/search.css

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.searcher {
22
position: fixed;
3-
top: var(--headerHeight);
3+
top: var(--webHeaderHeight);
44
right: 0;
55
padding: 10px;
66
background: var(--headerBackground);
@@ -13,7 +13,7 @@
1313
}
1414

1515
.is-darwin .searcher {
16-
top: 24px;
16+
top: calc(24px + var(--webHeaderHeight));
1717
}
1818

1919
.searcher-progress {
@@ -26,14 +26,15 @@
2626
}
2727

2828
.searcher-action {
29-
border: 1px solid var(--boxBorder);
30-
background: var(--labelBackground);
29+
border: 1px solid var(--searchActionBorder);
30+
background: var(--contentBackgorund);
3131
outline: none;
3232
padding: 0 8px;
3333
cursor: pointer;
3434
font-size: .875rem;
3535
height: 30px;
3636
overflow: hidden;
37+
color: var(--textColor);
3738
}
3839

3940
.searcher-prev {
@@ -54,11 +55,11 @@
5455
}
5556

5657
.searcher-action:hover {
57-
background: var(--boxBorder);
58+
background: var(--searchActionHoverBackground);
5859
}
5960

6061
.searcher-input {
61-
border: 1px solid var(--searchBorder);
62+
border: 1px solid var(--searchInputBorder);
6263
border-radius: 3px;
6364
padding: 0 5px;
6465
outline: none;
@@ -67,6 +68,7 @@
6768
margin-right: 5px;
6869
width: 200px;
6970
background-color: var(--contentBackground);
71+
color: var(--searchInputColor);
7072
}
7173

7274
.searcher-input:focus {

app/renderer/style.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,26 @@
11
:root {
2+
--textColor: #333;
23
--inputFocusBorder: #35b5f4 !important;
34
--headerBackground: #eee;
5+
--webHeaderHeight: 3rem;
6+
--searchBorder: #ccc;
7+
--searchInputBorder: #ccc;
8+
--searchActionBorder: #ccc;
9+
--searchActionHoverBackground: #ccc;
10+
--contentBackground: white;
411
}
512

613
@media (prefers-color-scheme: dark) {
714
:root {
15+
--textColor: #ccc;
816
--headerColor: #999;
917
--headerBackground: #1c1c1c;
18+
--searchBorder: black;
19+
--searchInputColor: white;
20+
--searchInputBorder: black;
21+
--contentBackground: #33373a;
22+
--searchActionBorder: black;
23+
--searchActionHoverBackground: #333;
1024
}
1125
}
1226

@@ -25,6 +39,8 @@ body {
2539
"Helvetica Neue",
2640
Arial,
2741
sans-serif;
42+
color: var(--textColor);
43+
background-color: var(--contentBackground);
2844
}
2945

3046
* {

0 commit comments

Comments
 (0)