Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: retain the style of having shortcut tip in search bar #280

Merged
merged 2 commits into from
Aug 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@
id="search-bar-input"
autofocus
/>

<span class="search-button__kbd-shortcut"
><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd>K</kbd></span
>
<style>
.bd-search .search-button__kbd-shortcut {
right: 33%;
}
</style>
{% if theme_use_meilisearch.index_uids %}
<select id="indexUidSelector" class="index-select">
{% for index_uid, index_name in theme_use_meilisearch.index_uids.items() %}
Expand Down
16 changes: 5 additions & 11 deletions src/ansys_sphinx_theme/theme/ansys_sphinx_theme/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,6 @@
{%- include "sections/header.html" %}
</nav>
{% endblock docs_navbar %}
<style>
.bd-main .bd-content .bd-article-container {
display: flex;
flex-direction: column;
justify-content: start;
max-width: 70em;
overflow-x: auto;
padding: 1rem;
width: 100%;
}
</style>
<div class="bd-container">
<div class="bd-container__inner bd-page-width">
{# Primary sidebar #}
Expand All @@ -47,6 +36,11 @@
{# Article content #} {% block docs_body %}
<div class="bd-search-container">
<h1>{{ _("Search") }}</h1>
<style>
.bd-search .search-button__kbd-shortcut {
display: none;
}
</style>
{% include "components/search-field.html" %}
</div>
{% endblock docs_body %} {# Article Footer #} {% if
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,46 +18,20 @@ div[data-ds-theme] .searchbox {
width: 100%;
max-width: 100%;
}

.dsb-suggestions {
width: 100%;
max-width: 480px;
}

.meilisearch-autocomplete .dsb-dropdown-menu [class^="dsb-dataset-"] {
max-width: 580px;
min-width: 430px;
width: 450px;
}

.bd-search input {
width: 270px !important;
width: 100% !important;
}

.index-select {
width: 180px;
}

.meilisearch-autocomplete .docs-searchbar-suggestion {
width: 450px;
width: 30%;
}
}

/* Styles for screens with a width of 1200px or less */
@media screen and (min-width: 1200px) {
div[data-ds-theme] .searchbox {
max-width: 800px;
}

.dsb-suggestions {
width: 100%;
max-width: 580px;
}

div[data-ds-theme] .meilisearch-autocomplete .dsb-dropdown-menu {
max-width: 870px;
min-width: 580px;
width: 850px;
max-width: 100%;
}

.bd-search input {
Expand All @@ -66,10 +40,19 @@ div[data-ds-theme] .searchbox {
.index-select {
width: 250px;
}
}
.dsb-suggestions {
width: 100%;
max-width: 140%;
}

div[data-ds-theme] .meilisearch-autocomplete .docs-searchbar-suggestion {
width: 735px;
}
div[data-ds-theme] .meilisearch-autocomplete .dsb-dropdown-menu {
max-width: 200%;
min-width: 100%;
width: 140%;
}
div[data-ds-theme] .meilisearch-autocomplete .docs-searchbar-suggestion {
width: 100%;
}

div[data-ds-theme] .searchbox input {
Expand Down
Loading