Skip to content

Commit 7f45b97

Browse files
authored
Dark mode support for search (#125)
1 parent 8ea7336 commit 7f45b97

File tree

2 files changed

+45
-58
lines changed

2 files changed

+45
-58
lines changed

src/scanpydoc/theme/static/styles/scanpy.css

+44
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,47 @@ dl.citation > dt {
2020
.pr {
2121
font-size: 70% !important;
2222
}
23+
24+
/* for the search */
25+
/*container*/
26+
html[data-theme="dark"] :is(.search__outer, .rtd__search__credits) {
27+
font-family: var(--pst-font-family-base);
28+
color: var(--pst-color-text-base);
29+
background-color: var(--pst-color-background);
30+
border-color: var(--pst-color-border);
31+
}
32+
html[data-theme="dark"] .rtd__search__credits a {
33+
color: var(--pst-color-link);
34+
}
35+
/*input*/
36+
html[data-theme="dark"] .search__outer__input {
37+
color: var(--pst-color-text-base);
38+
background-color: transparent;
39+
border-bottom-color: var(--pst-color-border);
40+
}
41+
html[data-theme="dark"] .search__outer .bar::before,
42+
html[data-theme="dark"] .search__outer .bar::after {
43+
background-color: var(--pst-color-accent);
44+
}
45+
/*results*/
46+
html[data-theme="dark"] :is(.search__result__subheading span, .search__result__single) {
47+
border-bottom-color: var(--pst-color-border);
48+
}
49+
html[data-theme="dark"] .search__result__single:last-of-type {
50+
border-bottom-width: 0;
51+
}
52+
html[data-theme="dark"]
53+
:is(.outer_div_page_results:hover, .search__result__box .active) {
54+
background-color: var(--pst-color-primary-highlight);
55+
}
56+
html[data-theme="dark"]
57+
:is(.search__error__box, .search__result__subheading, .search__result__content) {
58+
color: var(--pst-color-text-base);
59+
}
60+
html[data-theme="dark"]
61+
.search__outer
62+
:is(.search__result__content, .search__result__title)
63+
span {
64+
border-bottom-color: var(--pst-color-border);
65+
background-color: var(--pst-color-target);
66+
}

src/scanpydoc/theme/theme.conf

+1-58
Original file line numberDiff line numberDiff line change
@@ -5,67 +5,10 @@ sidebars = navbar-logo.html, icon-links.html, search-button-field.html, sbt-side
55
stylesheet = styles/scanpy.css
66

77
[options]
8+
# inherits from both of these:
89
# https://github.com/pydata/pydata-sphinx-theme/blob/v0.13.3/src/pydata_sphinx_theme/theme/pydata_sphinx_theme/theme.conf
9-
sidebarwidth = 270
10-
sidebar_includehidden = True
11-
use_edit_page_button = False
12-
external_links =
13-
bitbucket_url =
14-
github_url =
15-
gitlab_url =
16-
twitter_url =
17-
icon_links_label = Icon Links
18-
icon_links =
19-
analytics =
20-
favicons =
21-
show_prev_next = True
22-
search_bar_text = Search the docs ...
23-
search_bar_position = sidebar
24-
navigation_with_keys = True
25-
collapse_navigation = False
26-
navigation_depth = 4
27-
show_nav_level = 1
28-
show_toc_level = 1
29-
navbar_align = content
30-
header_links_before_dropdown = 5
31-
switcher =
32-
check_switcher = True
33-
pygment_light_style = a11y-high-contrast-light
34-
pygment_dark_style = a11y-high-contrast-dark
35-
logo =
36-
article_footer_items =
37-
content_footer_items =
38-
primary_sidebar_end = sidebar-ethical-ads.html
39-
4010
# https://github.com/executablebooks/sphinx-book-theme/blob/v1.0.1/src/sphinx_book_theme/theme/sphinx_book_theme/theme.conf
41-
announcement =
42-
secondary_sidebar_items = page-toc.html
43-
toc_title = Contents
44-
article_header_start = toggle-primary-sidebar.html
45-
article_header_end = article-header-buttons.html
46-
use_download_button = True
47-
use_fullscreen_button = True
48-
use_issues_button = False
49-
use_source_button = False
50-
use_repository_button = False
51-
path_to_docs =
52-
repository_url =
53-
repository_branch =
54-
repository_provider =
55-
launch_buttons = {}
56-
navbar_start =
57-
navbar_center =
58-
navbar_end =
59-
navbar_persistent =
60-
home_page_in_toc = False
61-
show_navbar_depth = 1
62-
extra_footer =
63-
footer_content_items = author.html, copyright.html, last-updated.html, extra-footer.html
64-
footer_start =
65-
footer_end =
66-
use_sidenotes = False
6711

68-
# added by scanpydoc
6912
accent_color =
7013
docsearch_key =
7114
docsearch_index =

0 commit comments

Comments
 (0)