Skip to content

Commit

Permalink
docs: move day/night toggle, make it more subtle
Browse files Browse the repository at this point in the history
  • Loading branch information
iamdefinitelyahuman committed Apr 12, 2020
1 parent 77635b8 commit 83a400a
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 33 deletions.
58 changes: 35 additions & 23 deletions docs/_static/css/toggle.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,35 @@ input[type=checkbox] {
visibility: hidden;
height: 0;
width: 0;
margin: 0;
}

.rst-versions .rst-current-version {
padding: 10px;
display: flex;
justify-content: space-between;
}

.rst-versions .rst-current-version .fa-book,
.rst-versions .rst-current-version .fa-v,
.rst-versions .rst-current-version .fa-caret-down {
height: 24px;
line-height: 24px;
vertical-align: middle;
}

.rst-versions .rst-current-version .fa-element {
width: 80px;
text-align: center;
}

.rst-versions .rst-current-version .fa-book {
text-align: left;
}

.rst-versions .rst-current-version .fa-v {
color: #27AE60;
text-align: right;
}

label {
Expand All @@ -13,8 +42,8 @@ label {
position: relative;
cursor: pointer;
text-indent: -9999px;
width: 55px;
height: 30px;
width: 50px;
height: 21px;
background: #000;
}

Expand All @@ -23,10 +52,10 @@ label:after {
position: absolute;
content: '';
background: #fff;
width: 20px;
height: 20px;
top: 5px;
left: 4px;
width: 15px;
height: 15px;
top: 3px;
left: 3px;
transition: ease-in-out 200ms;
}

Expand All @@ -45,21 +74,4 @@ html.transition *:before,
html.transition *:after {
transition: ease-in-out 200ms !important;
transition-delay: 0 !important;
}

ul.wy-breadcrumbs {
width: 100%;
}

ul.wy-breadcrumbs li {
display: inline-block;
}

ul.wy-breadcrumbs div.container {
float: right;
}

div#modetext {
font-weight: bolder;
text-align: center;
}
1 change: 0 additions & 1 deletion docs/_static/js/toggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ document.addEventListener('DOMContentLoaded', function() {
function toggleCssMode(isDay) {
var mode = (isDay ? "Day" : "Night");
localStorage.setItem("css-mode", mode);
document.getElementById('modetext').innerHTML = mode;

var darksheet = $('link[href="_static/css/dark.css"]')[0].sheet;
darksheet.disabled = isDay;
Expand Down
9 changes: 0 additions & 9 deletions docs/_templates/breadcrumbs.html

This file was deleted.

36 changes: 36 additions & 0 deletions docs/_templates/versions.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{# Add rst-badge after rst-versions for small badge style. #}
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions">
<span class="rst-current-version" data-toggle="rst-current-version">
<span class="fa fa-book fa-element"> RTD </span>

<span class="fa fa-element">
<input class="container_toggle" type="checkbox" id="switch" name="mode">
<label for="switch"></label>
</span>

<span class="fa fa-v fa-element"> v: {{ current_version }} <span class="fa fa-caret-down"></span></span>

</span>
<div class="rst-other-versions">
<dl>
<dt>{{ _('Versions') }}</dt> {% for slug, url in versions %}
<dd><a href="{{ url }}">{{ slug }}</a></dd>
{% endfor %}
</dl>
<dl>
<dt>{{ _('Downloads') }}</dt> {% for type, url in downloads %}
<dd><a href="{{ url }}">{{ type }}</a></dd>
{% endfor %}
</dl>
<dl>
{# Translators: The phrase "Read the Docs" is not translated #}
<dt>{{ _('On Read the Docs') }}</dt>
<dd>
<a href="//{{ PRODUCTION_DOMAIN }}/projects/{{ slug }}/?fromdocs={{ slug }}">{{ _('Project Home') }}</a>
</dd>
<dd>
<a href="//{{ PRODUCTION_DOMAIN }}/builds/{{ slug }}/?fromdocs={{ slug }}">{{ _('Builds') }}</a>
</dd>
</dl>
</div>
</div>

0 comments on commit 83a400a

Please sign in to comment.