Skip to content

Commit f644daa

Browse files
committed
WIP: Add dark mode to website [skip azp] [skip actions] [circle front]
1 parent 25e9451 commit f644daa

File tree

5 files changed

+27
-9
lines changed

5 files changed

+27
-9
lines changed

doc/_static/style.css

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@
88

99
}
1010

11+
html[data-theme="light"] {
12+
--mne-color-github: #000;
13+
--mne-color-discourse: #231e20,
14+
}
15+
html[data-theme="dark"] {
16+
--mne-color-github: #fff;
17+
--mne-color-discourse: #d1c498;
18+
}
19+
1120
/* ************************************************************ Sphinx fixes */
1221
dl.field-list {
1322
grid-template-columns: auto 1fr;
@@ -156,17 +165,23 @@ div.frontpage-gallery:hover .fadeout {
156165
opacity: 0.0;
157166
transition: 200ms linear;
158167
}
168+
div.card {
169+
background-color: rgb(var(--pst-color-background));
170+
}
171+
div.card img.institution {
172+
background-color: #fffe;
173+
}
159174

160175
/* ****************************************************** navbar quick links */
161176

162177
i.fa-github-square:before {
163-
color: #000;
178+
color: rgb(var(--mne-color-github));
164179
}
165180
i.fa-twitter-square:before {
166181
color: #55acee;
167182
}
168183
i.fa-discourse:before {
169-
color: #231e20;
184+
color: rgb(var(--mne-color-discourse));
170185
}
171186
i.fa-discord:before {
172187
color: #7289da; /* 99aab5 is also in-brand for discord */

doc/_templates/homepage.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<div class="col-12 col-sm-6 col-lg-4 my-2">
66
<div class="card frontpage-gallery">
77
<a href="{{ item.url }}">
8-
<img class="card-img" src="{{ item.img if item.img.startswith('http') else pathto('_images/' + item.img, 1) }}" alt="{{ item.alt }}">
8+
<img class="card-img institution" src="{{ item.img if item.img.startswith('http') else pathto('_images/' + item.img, 1) }}" alt="{{ item.alt }}">
99
<div class="card-img-overlay px-3 py-1">
1010
<p class="lead mb-1 fadeout">{{ item.title }}</p>
1111
<p class="card-text fadeout">{{ item.text }}</p>
@@ -23,7 +23,7 @@
2323
{% for item in funders -%}
2424
<div class="card my-1 mx-2 border-light" style="{{ 'width: ' + item.size + 'rem;' }}">
2525
<a href="{{ pathto('funding.html', 1) }}">
26-
<img class="card-img" src="{{ pathto('_static/funding/' + item.img, 1) }}" title="{{ item.title }}" alt="{{ item.title }}">
26+
<img class="card-img institution" src="{{ pathto('_static/funding/' + item.img, 1) }}" title="{{ item.title }}" alt="{{ item.title }}">
2727
</a>
2828
</div>
2929
{% endfor %}
@@ -36,7 +36,7 @@
3636
{% for inst in institutions -%}
3737
<div class="card my-1 mx-2 border-light" style="{{ 'width: ' + inst.size + 'rem;' }}">
3838
<a href="{{ inst.url }}">
39-
<img class="card-img" src="{{ pathto('_static/institution_logos/' + inst.img, 1) }}" title="{{ inst.name }}" alt="{{ inst.name }}"/>
39+
<img class="card-img institution" src="{{ pathto('_static/institution_logos/' + inst.img, 1) }}" title="{{ inst.name }}" alt="{{ inst.name }}"/>
4040
</a>
4141
</div>
4242
{% endfor %}

doc/conf.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ def append_attr_meth_examples(app, what, name, obj, options, lines):
575575
'use_edit_page_button': False,
576576
'navigation_with_keys': False,
577577
'show_toc_level': 1,
578-
'navbar_end': ['version-switcher', 'navbar-icon-links'],
578+
'navbar_end': ['theme-switcher', 'version-switcher', 'navbar-icon-links'],
579579
'footer_items': ['copyright'],
580580
'google_analytics_id': 'UA-37225609-1',
581581
'switcher': {
@@ -635,6 +635,9 @@ def append_attr_meth_examples(app, what, name, obj, options, lines):
635635
# variables to pass to HTML templating engine
636636
html_context = {
637637
'build_dev_html': bool(int(os.environ.get('BUILD_DEV_HTML', False))),
638+
'default_mode': 'auto',
639+
'pygment_light_style': 'tango',
640+
'pygment_dark_style': 'native',
638641
'funders': [
639642
dict(img='nih.png', size='3', title='National Institutes of Health'),
640643
dict(img='nsf.png', size='3.5',

doc/install/install_type_selector.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ <h6 class="card-subtitle mb-2 mt-2 text-muted">For Beginners</h6>
1212
everything to get you started!
1313
</p>
1414
</div>
15-
<div class="card-footer bg-white border-white"">
15+
<div class="card-footer"">
1616
<a class="btn btn-primary font-weight-bold shadow-sm mb-3" role="button" href="installers.html">
1717
<i class="fa fa-cloud-download-alt"></i>&ensp;Download Installers
1818
</a>
@@ -31,7 +31,7 @@ <h6 class="card-subtitle mb-2 mt-2 text-muted">For Advanced Users</h6>
3131
<code>conda</code>!
3232
</p>
3333
</div>
34-
<div class="card-footer bg-white border-white"">
34+
<div class="card-footer">
3535
<a class="btn btn-primary font-weight-bold shadow-sm mb-3" role="button" href="manual_install.html">
3636
<i class="fa fa-wrench"></i>&ensp;Setup Instructions
3737
</a>

requirements_doc.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# requirements for building docs
22
sphinx!=4.1.0
33
https://github.com/numpy/numpydoc/archive/main.zip
4-
https://github.com/pydata/pydata-sphinx-theme/archive/af02a6a5fe5c8f322f148274c5eeb4204638a7f4.zip
4+
https://github.com/pydata/pydata-sphinx-theme/archive/454918d43c9a9d10764aeccccfb1a7aca4918cfd.zip
55
https://github.com/sphinx-gallery/sphinx-gallery/archive/master.zip
66
sphinxcontrib-bibtex>=2.1.2
77
memory_profiler

0 commit comments

Comments
 (0)