|
1 |
| -<head> |
2 |
| - <style> |
3 |
| - .search-bar { |
4 |
| - display: flex; |
5 |
| - align-items: center; |
6 |
| - background-color: #fff; |
7 |
| - border: 1px solid #ccc; |
8 |
| - border-radius: 20px; |
9 |
| - padding: 4px; |
10 |
| - width: 50vw; |
11 |
| - } |
| 1 | +<style> |
| 2 | + .search-bar { |
| 3 | + display: flex; |
| 4 | + align-items: center; |
| 5 | + background-color: #fff; |
| 6 | + border: 1px solid #4c4c4c; |
| 7 | + border-radius: 20px; |
| 8 | + vertical-align: middle; |
| 9 | + flex-grow: 1; |
| 10 | + overflow-x: hidden; |
| 11 | + width: auto; |
| 12 | + } |
12 | 13 |
|
13 |
| - .search-bar:focus-within { |
14 |
| - border: 2.5px solid rgba(47, 135, 223, 0.7); |
15 |
| - } |
| 14 | + .search-bar:focus-within { |
| 15 | + border: 2.5px solid rgba(47, 135, 223, 0.7); |
| 16 | + } |
16 | 17 |
|
17 |
| - .search-bar i.fas { |
18 |
| - margin-right: 10px; |
19 |
| - } |
| 18 | + .search-bar i.search-icon { |
| 19 | + padding: .5em .5em .5em .75em; |
| 20 | + opacity: .75; |
| 21 | + } |
20 | 22 |
|
21 |
| - .td-search-input { |
22 |
| - font-family: sans-serif; |
23 |
| - } |
| 23 | + .search-input { |
| 24 | + flex: 1; |
| 25 | + border: none; |
| 26 | + outline: none; |
| 27 | + padding: .5em 0 .5em 0; |
| 28 | + } |
| 29 | +</style> |
24 | 30 |
|
25 |
| - .search-input { |
26 |
| - flex: 1; |
27 |
| - box-sizing: border-box; |
28 |
| - border: none; |
29 |
| - outline: none; |
30 |
| - padding: 8px; |
31 |
| - font-size: 16px; |
32 |
| - border-radius: 15px; |
33 |
| - } |
34 |
| - |
35 |
| - .search-input::placeholder { |
36 |
| - font-style: normal; |
37 |
| - font-weight: normal; |
38 |
| - font-size: 16px; |
39 |
| - color: #aaa; |
40 |
| - } |
41 |
| - </style> |
42 |
| - <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css"> |
43 |
| -</head> |
44 |
| - |
45 |
| -<body> |
46 |
| - {{ if or .Site.Params.gcs_engine_id .Site.Params.algolia_docsearch }} |
47 |
| - <div class="search-bar"> |
48 |
| - <i class="fas fa-search"></i> |
49 |
| - <input |
50 |
| - type="search" |
51 |
| - class="search-input td-search-input" |
52 |
| - placeholder="{{ T "ui_search_placeholder" }}" |
53 |
| - aria-label="{{ T "ui_search_placeholder" }}" |
54 |
| - autocomplete="off" |
55 |
| - > |
56 |
| - </div> |
57 |
| - {{ else if .Site.Params.offlineSearch }} |
58 |
| - <div class="search-bar" id="search-nav-container"> |
59 |
| - <i class="fas fa-search"></i> |
60 |
| - <input |
61 |
| - type="search" |
62 |
| - class="search-input td-search-input" |
63 |
| - id="search-input" |
64 |
| - placeholder="{{ T "ui_search_placeholder" }}" |
65 |
| - aria-label="{{ T "ui_search_placeholder" }}" |
66 |
| - autocomplete="off" |
67 |
| - > |
68 |
| - </div> |
69 |
| - {{ else if .Site.Params.k8s_search }} |
70 |
| - <div class="search-bar"> |
71 |
| - <i class="fas fa-search"></i> |
72 |
| - <input |
73 |
| - type="search" |
74 |
| - name="q" |
75 |
| - class="search-input td-search-input" |
76 |
| - placeholder="{{ T "ui_search_placeholder" }}" |
77 |
| - aria-label="{{ T "ui_search_placeholder" }}" |
78 |
| - autocomplete="off" |
79 |
| - > |
80 |
| - </div> |
81 |
| - {{ end }} |
82 |
| -</body> |
| 31 | +{{ if or .Site.Params.gcs_engine_id .Site.Params.algolia_docsearch }} |
| 32 | +<div class="search-bar"> |
| 33 | + <i class="search-icon fas fa-search"></i> |
| 34 | + <input |
| 35 | + type="search" |
| 36 | + class="search-input td-search-input" |
| 37 | + placeholder="{{ T "ui_search_placeholder" }}" |
| 38 | + aria-label="{{ T "ui_search_placeholder" }}" |
| 39 | + autocomplete="off" |
| 40 | + > |
| 41 | +</div> |
| 42 | +{{ else if .Site.Params.offlineSearch }} |
| 43 | +<div class="search-bar" id="search-nav-container"> |
| 44 | + <i class="search-icon fas fa-search"></i> |
| 45 | + <input |
| 46 | + type="search" |
| 47 | + class="search-input td-search-input" |
| 48 | + id="search-input" |
| 49 | + placeholder="{{ T "ui_search_placeholder" }}" |
| 50 | + aria-label="{{ T "ui_search_placeholder" }}" |
| 51 | + autocomplete="off" |
| 52 | + > |
| 53 | +</div> |
| 54 | +{{ else if .Site.Params.k8s_search }} |
| 55 | +<div class="search-bar"> |
| 56 | + <i class="search-icon fas fa-search"></i> |
| 57 | + <input |
| 58 | + type="search" |
| 59 | + name="q" |
| 60 | + class="search-input td-search-input" |
| 61 | + placeholder="{{ T "ui_search_placeholder" }}" |
| 62 | + aria-label="{{ T "ui_search_placeholder" }}" |
| 63 | + autocomplete="off" |
| 64 | + > |
| 65 | +</div> |
| 66 | +{{ end }} |
0 commit comments