Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 6 additions & 6 deletions assets/less/layout.less
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ body {
}

body.sidebar-opened, body.sidebar-opening {
.sidebar-toggle {
transform: translateX(250px)
.sidebar-button {
transform: translateX(250px);
}

@media screen and (max-width: 768px) {
Expand All @@ -81,17 +81,17 @@ body.sidebar-closed, body.sidebar-closing {
padding-left: 0;
}

.sidebar-toggle {
.sidebar-button {
transform: none;
}
}

body.sidebar-closed .sidebar-toggle {
body.sidebar-closed .sidebar-button {
color: @black;
}

body.sidebar-opening {
.sidebar-toggle {
.sidebar-button {
transition: transform 0.3s ease-in-out;
}

Expand All @@ -117,7 +117,7 @@ body.sidebar-opening {
}

body.sidebar-closing {
.sidebar-toggle {
.sidebar-button {
transition: transform 0.3s ease-in-out;
}

Expand Down
41 changes: 27 additions & 14 deletions assets/less/night/night.less
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
.night-mode-toggle {
background: none;
border: none;

&:after {
font-size: 12px;
content: 'Switch to night mode';
text-decoration: underline;
}
top: 1.5em;

&:focus {
outline: none;
}

.icon-theme::before {
@media screen and (max-width: 768px) { font-size: 1em; }

@media screen and (min-width: 769px) { font-size: 1.25em; }

@media screen and (min-width: 1281px) { font-size: 1.5em; }

content: "\e900";
}
}

body.night-mode {
Expand All @@ -21,12 +24,8 @@ body.night-mode {
background: @nightBackground;
}

.night-mode-toggle {
&:after {
color: @mediumGray;
content: 'Switch to day mode';
text-decoration: underline;
}
.night-mode-toggle .icon-theme::before {
content: "\e901";
}

#search .result-id a {
Expand All @@ -42,3 +41,17 @@ body.night-mode {
}

}

@media screen and (max-width: 768px) {
.night-mode-toggle {
transform: translateX(0);
left: 5px;
top: 1.5em;
}

.sidebar-opened {
.night-mode-toggle {
left: 18px;
}
}
}
6 changes: 3 additions & 3 deletions assets/less/night/sidebar.less
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
body.night-mode {
.sidebar-closed .sidebar-toggle, .sidebar-toggle {
color: @lightestGray;
}
.sidebar-closed .sidebar-button, .sidebar-button {
color: @lightestGray;
}
}
12 changes: 7 additions & 5 deletions assets/less/toggle.less
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
.sidebar-toggle {
.sidebar-button {
position: fixed;
z-index: 99;
left: 18px;
top: 8px;
color: @gray;
background-color: transparent;
border: none;
Expand All @@ -21,19 +20,22 @@
&:focus {
outline: none;
}

.sidebar-toggle {
top: 8px;
}
}

@media screen and (max-width: 768px) {
.sidebar-toggle {
.sidebar-button {
transform: translateX(0);
left: 5px;
top: 5px;
}

.sidebar-opened {
.sidebar-toggle {
.sidebar-button {
left: 18px;
top: 5px;
}
}
}
1 change: 0 additions & 1 deletion formatters/html/dist/app-c11171effc.css

This file was deleted.

1 change: 1 addition & 0 deletions formatters/html/dist/app-de6b7c05d7.css

Large diffs are not rendered by default.

Binary file modified formatters/html/fonts/icomoon.eot
Binary file not shown.
14 changes: 8 additions & 6 deletions formatters/html/fonts/icomoon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified formatters/html/fonts/icomoon.ttf
Binary file not shown.
Binary file modified formatters/html/fonts/icomoon.woff
Binary file not shown.
1 change: 0 additions & 1 deletion lib/ex_doc/formatter/html/templates/footer_template.eex
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<a href="https://twitter.com/dignifiedquire" target="_blank" title="@dignifiedquire">Friedel Ziegelmayer</a>.
</span>
</p>
<button class="night-mode-toggle"><span class="sr-only">Switch theme</span></button>
</footer>
</div>
</div>
Expand Down
6 changes: 5 additions & 1 deletion lib/ex_doc/formatter/html/templates/sidebar_template.eex
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<div class="main">
<button class="sidebar-toggle">
<button class="sidebar-button sidebar-toggle">
<span class="icon-menu" aria-hidden="true"></span>
<span class="sr-only">Toggle Sidebar</span>
</button>
<button class="sidebar-button night-mode-toggle">
<span class="icon-theme" aria-hidden="true"></span>
<span class="sr-only">Toggle Theme</span>
</button>
<section class="sidebar">

<% url = config.homepage_url || "#{config.main}.html" %>
Expand Down