Skip to content

Commit

Permalink
fix: improve style for algolia docsearch
Browse files Browse the repository at this point in the history
  • Loading branch information
lepture committed Apr 7, 2024
1 parent 41bc8ae commit 0e36e4c
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
44 changes: 44 additions & 0 deletions static/css/extensions/docsearch.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
html.light,
html.dark {
--docsearch-primary-color: var(--accent-9);
--docsearch-text-color: var(--sy-c-text);
--docsearch-modal-background: var(--sy-c-background);
--docsearch-footer-background: var(--sy-c-surface);
--docsearch-searchbox-background: var(--sy-c-surface);
--docsearch-searchbox-focus-background: var(--sy-c-background);
--docsearch-muted-color: var(--sy-c-light);
--docsearch-hit-color: var(--sy-c-text);
--docsearch-hit-background: var(--sy-c-surface);
--docsearch-hit-active-color: var(--accent-9-contrast);
--docsearch-hit-shadow: inset 0 0 1px 0 var(--gray-a11);
--docsearch-container-background: var(--sy-c-overlay);
}
html.light {
--docsearch-key-gradient: linear-gradient(-225deg, #e6e6e6, #f8f8f8);
--docsearch-key-shadow: inset 0 -2px #dbdbdb, inset 0 0 1px 1px #fff, 0 1px 2px 1px #50505066;
}
html.dark {
--docsearch-key-gradient: linear-gradient(-225deg, #353434, #141414);
--docsearch-key-shadow: inset 0 -2px #373737, inset 0 0 1px 1px #222, 0 1px 2px 1px #000;
--docsearch-footer-shadow: 0 -1px 0 0 #373737,0 -3px 6px 0 #141414;
--docsearch-modal-shadow: inset 1px 1px 0 0 #373737,0 3px 8px 0 #141414;
}

#docsearch .DocSearch-Button {
border-radius: 6px;
}

#docsearch .DocSearch-Button-Key,
#docsearch .DocSearch-Button-Placeholder {
font-size: 0.825rem;
}

#docsearch .DocSearch-Button-Placeholder,
#docsearch .DocSearch-Button-Keys {
display: flex !important;
}

#docsearch .DocSearch-Search-Icon {
width: 0.875rem !important;
height: 0.875rem !important;
}
1 change: 1 addition & 0 deletions static/css/modules.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@
@import "./extensions/jupyter.css";
@import "./extensions/nbsphinx.css";
@import "./extensions/sphinx-gallery.css";
@import "./extensions/docsearch.css";
@import "./extensions/misc.css";

0 comments on commit 0e36e4c

Please sign in to comment.