diff --git a/src/css/search2.css b/src/css/search2.css new file mode 100644 index 0000000..66e459e --- /dev/null +++ b/src/css/search2.css @@ -0,0 +1,522 @@ +.searchbox { + display: inline-block; + position: relative; + width: 200px; + height: 32px !important; + white-space: nowrap; + box-sizing: border-box; + visibility: visible !important; +} + +.searchbox .meilisearch-autocomplete { + display: block; + width: 100%; + height: 100%; +} + +.searchbox__wrapper { + width: 100%; + height: 100%; + z-index: 999; + position: relative; +} + +.searchbox__input { + display: inline-block; + box-sizing: border-box; + transition: box-shadow 0.4s ease, background 0.4s ease; + border: 0; + border-radius: 16px; + box-shadow: inset 0 0 0 1px #ccc; + background: #fff !important; + padding: 0 26px 0 32px; + width: 100%; + height: 100%; + vertical-align: middle; + white-space: normal; + font-size: 12px; + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; +} + +.searchbox__input::-webkit-search-cancel-button, +.searchbox__input::-webkit-search-decoration, +.searchbox__input::-webkit-search-results-button, +.searchbox__input::-webkit-search-results-decoration { + display: none; +} + +.searchbox__input:hover { + box-shadow: inset 0 0 0 1px #b3b3b3; +} + +.searchbox__input:active, +.searchbox__input:focus { + outline: 0; + box-shadow: inset 0 0 0 1px #aaa; + background: #fff; +} + +.searchbox__input::-moz-placeholder { + color: #aaa; +} + +.searchbox__input:-ms-input-placeholder { + color: #aaa; +} + +.searchbox__input::placeholder { + color: #aaa; +} + +.searchbox__submit { + position: absolute; + top: 0; + margin: 0; + border: 0; + border-radius: 16px 0 0 16px; + background-color: rgba(69, 142, 225, 0); + padding: 0; + width: 32px; + height: 100%; + vertical-align: middle; + text-align: center; + font-size: inherit; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + right: inherit; + left: 0; +} + +.searchbox__submit::before { + display: inline-block; + margin-right: -4px; + height: 100%; + vertical-align: middle; + content: ""; +} + +.searchbox__submit:active, +.searchbox__submit:hover { + cursor: pointer; +} + +.searchbox__submit:focus { + outline: 0; +} + +.searchbox__submit svg { + width: 14px; + height: 14px; + vertical-align: middle; + fill: #6d7e96; +} + +.searchbox__reset { + display: block; + position: absolute; + top: 8px; + right: 8px; + margin: 0; + border: 0; + background: none; + cursor: pointer; + padding: 0; + font-size: inherit; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + fill: rgba(0, 0, 0, 0.5); +} + +.searchbox__reset.hide { + display: none; +} + +.searchbox__reset:focus { + outline: 0; +} + +.searchbox__reset svg { + display: block; + margin: 4px; + width: 8px; + height: 8px; +} + +.searchbox__input:valid ~ .searchbox__reset { + display: block; + -webkit-animation-name: sbx-reset-in; + animation-name: sbx-reset-in; + -webkit-animation-duration: 0.15s; + animation-duration: 0.15s; +} + +@-webkit-keyframes sbx-reset-in { + 0% { + transform: translate3d(-20%, 0, 0); + opacity: 0; + } + + to { + transform: none; + opacity: 1; + } +} + +@keyframes sbx-reset-in { + 0% { + transform: translate3d(-20%, 0, 0); + opacity: 0; + } + + to { + transform: none; + opacity: 1; + } +} + +.meilisearch-autocomplete.meilisearch-autocomplete-right .dsb-dropdown-menu { + right: 0 !important; + left: inherit !important; +} + +.meilisearch-autocomplete.meilisearch-autocomplete-right .dsb-dropdown-menu::before { + right: 48px; +} + +.meilisearch-autocomplete.meilisearch-autocomplete-left .dsb-dropdown-menu { + left: 0 !important; + right: inherit !important; +} + +.meilisearch-autocomplete.meilisearch-autocomplete-left .dsb-dropdown-menu::before { + left: 48px; +} + +.meilisearch-autocomplete .dsb-dropdown-menu { + position: relative; + top: -6px; + border-radius: 4px; + margin: 6px 0 0; + padding: 0; + text-align: left; + height: auto; + background: transparent; + border: none; + z-index: 999; + max-width: 600px; + min-width: 500px; + box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.2), 0 2px 3px 0 rgba(0, 0, 0, 0.1); +} + +.meilisearch-autocomplete .dsb-dropdown-menu::before { + display: block; + position: absolute; + content: ""; + width: 14px; + height: 14px; + background: #fff; + z-index: 1000; + top: -7px; + border-top: 1px solid #d9d9d9; + border-right: 1px solid #d9d9d9; + transform: rotate(-45deg); + border-radius: 2px; +} + +.meilisearch-autocomplete .dsb-dropdown-menu .dsb-suggestions { + position: relative; + z-index: 1000; + margin-top: 8px; +} + +.meilisearch-autocomplete .dsb-dropdown-menu .dsb-suggestions a:hover { + text-decoration: none; +} + +.meilisearch-autocomplete .dsb-dropdown-menu .dsb-suggestion { + cursor: pointer; +} + +.meilisearch-autocomplete .dsb-dropdown-menu .dsb-suggestion.dsb-cursor .docs-searchbar-suggestion.suggestion-layout-simple, +.meilisearch-autocomplete .dsb-dropdown-menu .dsb-suggestion.dsb-cursor .docs-searchbar-suggestion:not(.suggestion-layout-simple) .docs-searchbar-suggestion--content { + background-color: rgba(69, 142, 225, 0.05); +} + +.meilisearch-autocomplete .dsb-dropdown-menu [class^=dsb-dataset-] { + position: relative; + border: 1px solid #d9d9d9; + background: #fff; + border-radius: 4px; + overflow: auto; + padding: 0 8px 8px; +} + +.meilisearch-autocomplete .dsb-dropdown-menu * { + box-sizing: border-box; +} + +.meilisearch-autocomplete .docs-searchbar-suggestion { + display: block; + position: relative; + padding: 0 8px; + background: #fff; + color: #02060c; + overflow: hidden; +} + +.meilisearch-autocomplete .docs-searchbar-suggestion--highlight { + color: #174d8c; + background: rgba(143, 187, 237, 0.1); + padding: 0 0.05em; +} + +.meilisearch-autocomplete .docs-searchbar-suggestion--category-header .docs-searchbar-suggestion--category-header-lvl0 .docs-searchbar-suggestion--highlight, +.meilisearch-autocomplete .docs-searchbar-suggestion--category-header .docs-searchbar-suggestion--category-header-lvl1 .docs-searchbar-suggestion--highlight, +.meilisearch-autocomplete .docs-searchbar-suggestion--text .docs-searchbar-suggestion--highlight { + padding: 0 0 1px; + background-color: yellow; + box-shadow: inset 0 -2px 0 0 rgba(69, 142, 225, 0.8); + color: inherit; +} + +.meilisearch-autocomplete .docs-searchbar-suggestion--content { + display: block; + float: right; + width: 70%; + position: relative; + padding: 5.33333px 0 5.33333px 10.66667px; + cursor: pointer; +} + +.meilisearch-autocomplete .docs-searchbar-suggestion--content::before { + content: ""; + position: absolute; + display: block; + top: 0; + height: 100%; + width: 1px; + background: #ddd; + left: -1px; +} + +.meilisearch-autocomplete .docs-searchbar-suggestion--category-header { + position: relative; + border-bottom: 1px solid #ddd; + display: none; + margin-top: 8px; + padding: 4px 0; + font-size: 1em; + color: #33363d; +} + +.meilisearch-autocomplete .docs-searchbar-suggestion--wrapper { + width: 100%; + float: left; + padding: 8px 0 0; +} + +.meilisearch-autocomplete .docs-searchbar-suggestion--subcategory-column { + float: left; + width: 30%; + text-align: right; + position: relative; + padding: 5.33333px 10.66667px; + color: #a4a7ae; + font-size: 0.9em; + word-wrap: break-word; +} + +.meilisearch-autocomplete .docs-searchbar-suggestion--subcategory-column::before { + content: ""; + position: absolute; + display: block; + top: 0; + height: 100%; + width: 1px; + background: #ddd; + right: 0; +} + +.meilisearch-autocomplete .docs-searchbar-suggestion--subcategory-inline { + display: none; +} + +.meilisearch-autocomplete .docs-searchbar-suggestion--title { + margin-bottom: 4px; + color: #02060c; + font-size: 0.9em; + font-weight: 700; +} + +.meilisearch-autocomplete .docs-searchbar-suggestion--text { + display: block; + line-height: 1.2em; + font-size: 0.85em; + color: #63676d; +} + +.meilisearch-autocomplete .docs-searchbar-suggestion--no-results { + width: 100%; + padding: 8px 0; + text-align: center; + font-size: 1.2em; +} + +.meilisearch-autocomplete .docs-searchbar-suggestion--no-results::before { + display: none; +} + +.meilisearch-autocomplete .docs-searchbar-suggestion code { + padding: 1px 5px; + font-size: 90%; + border: none; + color: #222; + background-color: #ebebeb; + border-radius: 3px; + font-family: Menlo, Monaco, Consolas, Courier New, monospace; +} + +.meilisearch-autocomplete .docs-searchbar-suggestion code .docs-searchbar-suggestion--highlight { + background: none; +} + +.meilisearch-autocomplete .docs-searchbar-suggestion.docs-searchbar-suggestion__main .docs-searchbar-suggestion--category-header, +.meilisearch-autocomplete .docs-searchbar-suggestion.docs-searchbar-suggestion__secondary { + display: block; +} + +@media (min-width: 768px) { + .meilisearch-autocomplete .docs-searchbar-suggestion .docs-searchbar-suggestion--subcategory-column { + display: block; + } +} + +@media (max-width: 768px) { + .meilisearch-autocomplete .docs-searchbar-suggestion .docs-searchbar-suggestion--subcategory-column { + display: inline-block; + width: auto; + text-align: left; + float: left; + padding: 0; + color: #02060c; + font-size: 0.9em; + font-weight: 700; + opacity: 0.5; + } + + .meilisearch-autocomplete .docs-searchbar-suggestion .docs-searchbar-suggestion--subcategory-column::before { + display: none; + } + + .meilisearch-autocomplete .docs-searchbar-suggestion .docs-searchbar-suggestion--subcategory-column::after { + content: "|"; + } + + .meilisearch-autocomplete .docs-searchbar-suggestion .docs-searchbar-suggestion--content { + display: inline-block; + width: auto; + text-align: left; + float: left; + padding: 0; + } + + .meilisearch-autocomplete .docs-searchbar-suggestion .docs-searchbar-suggestion--content::before { + display: none; + } +} + +.meilisearch-autocomplete .suggestion-layout-simple.docs-searchbar-suggestion { + border-bottom: 1px solid #eee; + padding: 8px; + margin: 0; +} + +.meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--content { + width: 100%; + padding: 0; +} + +.meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--content::before { + display: none; +} + +.meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--category-header { + margin: 0; + padding: 0; + display: block; + width: 100%; + border: none; +} + +.meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--category-header-lvl0, +.meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--category-header-lvl1 { + opacity: 0.6; + font-size: 0.85em; +} + +.meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--category-header-lvl1::before { + background-image: url('data:image/svg+xml;utf8,'); + content: ""; + width: 10px; + height: 10px; + display: inline-block; +} + +.meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--wrapper { + width: 100%; + float: left; + margin: 0; + padding: 0; +} + +.meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--duplicate-content, +.meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--subcategory-inline { + display: none !important; +} + +.meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--title { + margin: 0; + color: #458ee1; + font-size: 0.9em; + font-weight: 400; +} + +.meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--title::before { + content: "#"; + font-weight: 700; + color: #458ee1; + display: inline-block; +} + +.meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--text { + margin: 4px 0 0; + display: block; + line-height: 1.4em; + padding: 5.33333px 8px; + background: #f8f8f8; + font-size: 0.85em; + opacity: 0.8; +} + +.meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--text .docs-searchbar-suggestion--highlight { + color: #3f4145; + font-weight: 700; + box-shadow: none; +} + +.meilisearch-autocomplete .docs-searchbar-footer { + height: 20px; + z-index: 2000; + margin-top: 10.66667px; + float: right; +} + +.meilisearch-autocomplete .docs-searchbar-footer-logo { + vertical-align: middle; +} diff --git a/src/css/site.css b/src/css/site.css index 062457c..c6e031d 100644 --- a/src/css/site.css +++ b/src/css/site.css @@ -17,3 +17,4 @@ @import "print.css"; @import "search.css"; @import "admonitions.css"; +@import "search2.css"; diff --git a/src/partials/head-scripts.hbs b/src/partials/head-scripts.hbs index bd468bc..68d4ffe 100644 --- a/src/partials/head-scripts.hbs +++ b/src/partials/head-scripts.hbs @@ -4,6 +4,16 @@ {{/with}} + +