Skip to content

Commit

Permalink
Move Algolia styling to Styleguide
Browse files Browse the repository at this point in the history
  • Loading branch information
MinThaMie authored and mansona committed Aug 17, 2023
1 parent eadd4ae commit 7bc7b95
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 0 deletions.
1 change: 1 addition & 0 deletions addon/styles/addon.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
@import 'icon.css';
@import 'sidebar-container.css';
@import 'well.css';
@import 'algolia-search.css';

/* Helpers */
@import 'helpers/index.css';
Expand Down
78 changes: 78 additions & 0 deletions addon/styles/algolia-search.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#search-input {
border-radius: 18px;
border: 2px solid var(--color-card-border);
line-height: 30px;
padding-left: 8px;
width: 100%;
}

/* Dropdown styling */
.ds-dropdown-results {
z-index: 1; /* makes sure that the search is above the version selector */
}
.ds-dropdown-menu {
width: 500px;
background-color: white;
color: black;
border-radius: 8px;
margin-top: 10px;
border: 2px solid var(--color-card-border);
overflow-x: hidden;
}

/* Dropdown header styling */
.algolia-docsearch-suggestion__main {
background-color: var(--color-info);
padding: 8px 16px;
}

.algolia-docsearch-suggestion__main > .algolia-docsearch-suggestion--wrapper {
border: none;
padding: 0;
}

/* No results styling */
.algolia-docsearch-suggestion--noresults {
color: var(--color-gray-600);
padding: 8px 16px;
}

/* Result styling */
.algolia-docsearch-suggestion--wrapper {
display: flex;
border-bottom: 1px solid var(--color-card-border);
gap: 10px;
font-size: 14px;
padding: 8px 16px;
}

.algolia-docsearch-suggestion--subcategory-column {
flex-basis: 80px;
min-width: 80px;
}

.algolia-docsearch-suggestion--subcategory-column-text {
font-weight: bold;
}

/* Search sponsor styling */
.powered-by-algolia {
display: flex;
justify-content: end;
margin: 8px;
}
.powered-by-algolia > a {
display: flex;
}

@media (min-width: 1008px) {
.navbar-list {
flex-grow: 1;
}
}

@media (max-width: 1007px) {
.ds-dropdown-menu {
width: calc(100vw - 2rem);
}
}
3 changes: 3 additions & 0 deletions docs/concepts/search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Algolia Search style overrides

We use Algolia as search engine. This comes with some default styling which we've updated a bit to look nicer and fit more with our theme.

0 comments on commit 7bc7b95

Please sign in to comment.