Skip to content

Commit

Permalink
Fix 'Show/Hide TOC' glitch in dark mode (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
perlun authored Apr 7, 2021
1 parent 5bd8d97 commit 7796e22
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.PHONY: \
all docs
all docs release

all: docs

Expand All @@ -22,3 +22,6 @@ docs-serve:
docfx/docfx.exe:
wget -qO- https://github.com/dotnet/docfx/releases/download/v2.51/docfx.zip | busybox unzip - -d docfx
chmod +x docfx/docfx.exe

release: all
zip -9r darkerfx-`git describe --tags --abbrev=0`.zip darkerfx/
10 changes: 10 additions & 0 deletions darkerfx/partials/toc.tmpl.partial
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{{!Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE file in the project root for full license information.}}

<div class="sidenav hide-when-search">
<div class="toc-toggle">
<a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
</div>
<div class="sidetoggle collapse" id="sidetoggle">
<div id="sidetoc"></div>
</div>
</div>
32 changes: 31 additions & 1 deletion darkerfx/styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ body.theme-dark {
--theme-sidenav-border: #404040;
--theme-sidenav-background: #2d2d30;
--theme-sidenav-filter-background: #1d1d1d;
--theme-sidenav-toc-toggle-background: #1d1d1d;
--theme-sidenav-toc-toggle-hover: #fff;
--theme-toc-hover: #fff;
--theme-background: #2d2d30;
--theme-body-background: #171717;
Expand Down Expand Up @@ -54,6 +56,8 @@ body.theme-light {
--theme-sidenav-border: #e7e7e7;
--theme-sidenav-background: #f1f1f1;
--theme-sidenav-filter-background: #ffffff;
--theme-sidenav-toc-toggle-background: #f1f1f1;
--theme-sidenav-toc-toggle-hover: #337ab7;
--theme-toc-hover: #4c4c4c;
--theme-background: #ffffff;
--theme-body-background: #ffffff;
Expand Down Expand Up @@ -138,8 +142,34 @@ article h4 {
background-color: var(--theme-sidenav-background);
}

.sidenav {
background-color: var(--theme-sidenav-background);
padding-top: 0;
}

.sidenav>div.toc-toggle {
background-color: var(--theme-sidenav-toc-toggle-background);
margin: 0;
padding-top: 0px;
}

.sidenav a.toc-toggle {
color: var(--theme-navbar);
}

.sidenav a.toc-toggle:focus,
.sidenav a.toc-toggle:hover {
color: var(--theme-sidenav-toc-toggle-hover);
}

.sidenav>.sidetoggle {
background-color: var(--theme-sidenav-background);
}

body.theme-dark {
button, a {

button,
a {
color: #5999d8;
}

Expand Down

0 comments on commit 7796e22

Please sign in to comment.