Skip to content

Commit

Permalink
Dark mode support for search (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
flying-sheep authored Jan 12, 2024
1 parent 8ea7336 commit 7f45b97
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 58 deletions.
44 changes: 44 additions & 0 deletions src/scanpydoc/theme/static/styles/scanpy.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,47 @@ dl.citation > dt {
.pr {
font-size: 70% !important;
}

/* for the search */
/*container*/
html[data-theme="dark"] :is(.search__outer, .rtd__search__credits) {
font-family: var(--pst-font-family-base);
color: var(--pst-color-text-base);
background-color: var(--pst-color-background);
border-color: var(--pst-color-border);
}
html[data-theme="dark"] .rtd__search__credits a {
color: var(--pst-color-link);
}
/*input*/
html[data-theme="dark"] .search__outer__input {
color: var(--pst-color-text-base);
background-color: transparent;
border-bottom-color: var(--pst-color-border);
}
html[data-theme="dark"] .search__outer .bar::before,
html[data-theme="dark"] .search__outer .bar::after {
background-color: var(--pst-color-accent);
}
/*results*/
html[data-theme="dark"] :is(.search__result__subheading span, .search__result__single) {
border-bottom-color: var(--pst-color-border);
}
html[data-theme="dark"] .search__result__single:last-of-type {
border-bottom-width: 0;
}
html[data-theme="dark"]
:is(.outer_div_page_results:hover, .search__result__box .active) {
background-color: var(--pst-color-primary-highlight);
}
html[data-theme="dark"]
:is(.search__error__box, .search__result__subheading, .search__result__content) {
color: var(--pst-color-text-base);
}
html[data-theme="dark"]
.search__outer
:is(.search__result__content, .search__result__title)
span {
border-bottom-color: var(--pst-color-border);
background-color: var(--pst-color-target);
}
59 changes: 1 addition & 58 deletions src/scanpydoc/theme/theme.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,67 +5,10 @@ sidebars = navbar-logo.html, icon-links.html, search-button-field.html, sbt-side
stylesheet = styles/scanpy.css

[options]
# inherits from both of these:
# https://github.com/pydata/pydata-sphinx-theme/blob/v0.13.3/src/pydata_sphinx_theme/theme/pydata_sphinx_theme/theme.conf
sidebarwidth = 270
sidebar_includehidden = True
use_edit_page_button = False
external_links =
bitbucket_url =
github_url =
gitlab_url =
twitter_url =
icon_links_label = Icon Links
icon_links =
analytics =
favicons =
show_prev_next = True
search_bar_text = Search the docs ...
search_bar_position = sidebar
navigation_with_keys = True
collapse_navigation = False
navigation_depth = 4
show_nav_level = 1
show_toc_level = 1
navbar_align = content
header_links_before_dropdown = 5
switcher =
check_switcher = True
pygment_light_style = a11y-high-contrast-light
pygment_dark_style = a11y-high-contrast-dark
logo =
article_footer_items =
content_footer_items =
primary_sidebar_end = sidebar-ethical-ads.html

# https://github.com/executablebooks/sphinx-book-theme/blob/v1.0.1/src/sphinx_book_theme/theme/sphinx_book_theme/theme.conf
announcement =
secondary_sidebar_items = page-toc.html
toc_title = Contents
article_header_start = toggle-primary-sidebar.html
article_header_end = article-header-buttons.html
use_download_button = True
use_fullscreen_button = True
use_issues_button = False
use_source_button = False
use_repository_button = False
path_to_docs =
repository_url =
repository_branch =
repository_provider =
launch_buttons = {}
navbar_start =
navbar_center =
navbar_end =
navbar_persistent =
home_page_in_toc = False
show_navbar_depth = 1
extra_footer =
footer_content_items = author.html, copyright.html, last-updated.html, extra-footer.html
footer_start =
footer_end =
use_sidenotes = False

# added by scanpydoc
accent_color =
docsearch_key =
docsearch_index =
Expand Down

0 comments on commit 7f45b97

Please sign in to comment.