Modify search form and CSS file

This commit is contained in:
Ethan Yoo 2022-12-29 10:54:17 -05:00
parent fb3dc57f1b
commit 185b64db27
Signed by: ethan
GPG Key ID: 70596474C5D20F85
2 changed files with 7 additions and 21 deletions

View File

@ -1,10 +1,11 @@
<!-- layouts/partials/search.html --> <!-- layouts/partials/search.html -->
<form id="search-form" class="noscript" method="GET" action="https://duckduckgo.com/" data-language-prefix="{{ site.LanguagePrefix }}"> <form id="search-form" class="noscript" method="GET" action="https://duckduckgo.com/">
<div class="search-bar"> <div class="search-bar">
<input id="search-input" class="search--display" name="q" tabindex="0" autocomplete="off" {{ with site.BaseURL }}value=" site:{{ . }}"{{ end }} placeholder="{{ i18n "search" }}"> <input id="search-input" class="search--display" name="q" tabindex="0" autocomplete="off" {{ with site.BaseURL }}value=" site:{{ . }}"{{ end }} placeholder="{{ "Search" }}">
<input id="search-submit" class="icon" type="submit" value="⌕"> <input id="search-submit" class="icon" type="submit" value="⌕">
</div> </div>
<ul id="search-results" class="search--display"></ul> <ul id="search-results" class="search--display"></ul>
</form> </form>
<!-- <script src="{{ "/js/fuse.js" | relURL }}"></script> --> <!-- <script src="{{ "/js/fuse.js" | relURL }}"></script> -->
<script src="{{ "/js/fixedsearch.js" | relURL }}"></script> <script src="{{ "/js/fixedsearch.js" | relURL }}"></script>
<link rel="stylesheet" href="/css/search.css?rnd={{ now.Unix }}">

View File

@ -1,9 +1,9 @@
#search-form { #search-form {
display: block; display: block;
position: fixed; position: fixed;
top: 0; top: 5px;
right: 0; right: 5px;
margin: 0; margin: 5px;
padding: 0; padding: 0;
min-width: var(--icon-size, 1.2rem); min-width: var(--icon-size, 1.2rem);
max-width: 15rem; max-width: 15rem;
@ -23,14 +23,12 @@
align-items: center; align-items: center;
} }
#search-form .search-bar { #search-form .search-bar {
background: rgb(var(--page-color, '240,240,240'));
color: rgb(var(--text-color, '3,3,3')); color: rgb(var(--text-color, '3,3,3'));
} }
#search-form[data-focus='true'] .search-bar { #search-form[data-focus='true'] .search-bar {
border: 2.5px solid rgb(var(--accent-color, '0,0,255')); border: 2.5px solid rgb(var(--accent-color, '0,0,255'));
} }
#search-form[data-focus='true'] .search-bar:not(:focus-within) { #search-form[data-focus='true'] .search-bar:not(:focus-within) {
background: rgb(var(--text-color, '3,3,3'));
color: rgb(var(--page-color, '240,240,240')); color: rgb(var(--page-color, '240,240,240'));
border-color: rgb(var(--text-color, '3,3,3')); border-color: rgb(var(--text-color, '3,3,3'));
} }
@ -45,17 +43,7 @@
color: inherit; color: inherit;
outline: none; outline: none;
text-align: left; text-align: left;
font-size: var(--s-2, 0.8rem); /* font-size: var(--s-2, 0.8rem); */
}
#search-submit {
display: block;
margin: 0 var(--icon-pad, 0.1rem) 0 0;
padding: 0;
width: var(--icon-size, 1.2rem);
height: var(--icon-size, 1.2rem);
line-height: var(--icon-size, 1.2rem);
background: inherit;
color: inherit;
} }
#search-submit:hover, #search-submit:hover,
#search-submit:focus { #search-submit:focus {
@ -84,7 +72,6 @@
#search-results li { #search-results li {
margin: 0; margin: 0;
width: 100%; width: 100%;
background-color: rgba(var(--page-color, '240,240,240'), var(--page-color-transparency, 0.89));
border-top: 0.5px dashed; border-top: 0.5px dashed;
list-style: none; list-style: none;
} }
@ -99,12 +86,10 @@
} }
#search-results a:hover, #search-results a:hover,
#search-results a:focus { #search-results a:focus {
background: rgb(var(--text-color, '3,3,3'));
color: rgb(var(--page-color, '240,240,240')); color: rgb(var(--page-color, '240,240,240'));
outline: 0; outline: 0;
} }
#search-results a:active { #search-results a:active {
background: rgb(var(--accent-color, '0,0,255'));
color: rgb(var(--page-color, '240,240,240')); color: rgb(var(--page-color, '240,240,240'));
} }
#search-results li span:empty { #search-results li span:empty {