Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix dark theme issues
  • Loading branch information
septatrix committed Nov 18, 2022
commit 31e888d6065c70fff4bd62e06640bc22000fe28b
11 changes: 1 addition & 10 deletions python_docs_theme/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ <h3>{{ _('Navigation') }}</h3>
{{ reldelim2 }}
</li>
{%- endif %}
<li class="right"><input type="button" value="Toggle theme" class="theme-toggle" onclick="toggleTheme()">{{ reldelim2 }}</li>
{% endblock %}
</ul>
</div>
Expand All @@ -59,16 +60,6 @@ <h3>{{ _('Navigation') }}</h3>
{% block relbar1 %} {% if builder != 'qthelp' %} {{ relbar() }} {% endif %} {% endblock %}
{% block relbar2 %} {% if builder != 'qthelp' %} {{ relbar() }} {% endif %} {% endblock %}

{% block relbaritems %}
{%- if pagename != "search" and builder != "singlehtml" and builder != "htmlhelp" %}
<li class="right">
{{ searchbox() }}
{{ reldelim2 }}
</li>
{%- endif %}
<li class="right"><input type="button" value="Toggle theme" class="theme-toggle" onclick="toggleTheme()">{{ reldelim2 }}</li>
{% endblock %}

{%- block extrahead -%}
<link rel="stylesheet" href="{{ pathto('_static/pydoctheme_dark.css', 1) }}" media="(prefers-color-scheme: dark)" id="pydoctheme_dark_css">
<link rel="shortcut icon" type="image/png" href="{{ pathto('_static/' + theme_root_icon, 1) }}" />
Expand Down
26 changes: 9 additions & 17 deletions python_docs_theme/static/pydoctheme.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,23 @@ body {
}

div.related {
margin-top: 0.5em;
margin-bottom: 1.2em;
padding: 0.5em 0;
border-top: 1px solid #ccc;
margin-top: 0.5em;
border-width: 1px;
border-color: #ccc;
}

div.related a:hover {
color: #0095c4;
.mobile-nav + div.related {
border-bottom-style: solid;
}

div.related ~ div.related {
border-top: 1px solid #ccc;
border-bottom: none;
.document + div.related {
border-top-style: solid;
}

div.related:first-child {
border-top: 0;
border-bottom: 1px solid #ccc;
div.related a:hover {
color: #0095c4;
}

.related .switchers {
Expand All @@ -62,13 +61,6 @@ div.related:first-child {
margin-right: 5px;
}

.version_switcher_placeholder,
.language_switcher_placeholder {
padding-left: 5px;
background-color: white;
}


div.related ul::after {
content: '';
clear: both;
Expand Down
7 changes: 1 addition & 6 deletions python_docs_theme/static/pydoctheme_dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,7 @@ body {

div.related {
color: rgba(255, 255, 255, 0.7); /* classic overwrite */
border-top-color: #424242;
}

div.related:first-child {
/* use :first-child because border-color would need !important */
border-bottom-color: #424242;
border-color: #424242;
}

/* SIDEBAR */
Expand Down