Skip to content

Commit

Permalink
(docs) Fix bug with missing 'Show/Hide TOC' background styling in dar…
Browse files Browse the repository at this point in the history
…k mode (#176)

Followup to #175, this implements some of the remaining parts of #174.
  • Loading branch information
perlun authored Apr 7, 2021
1 parent 3178955 commit 6eccf20
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"MSIL",
"Per's",
"Waka",
"darkfx",
"hljs",
"sidetoc"
"sidetoc",
"steffen"
]
}
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@ clean:
docs-clean:
rm -rf _site

docs: docfx/docfx.exe
docs: docfx/docfx.exe docs/templates/darkerfx/styles/main.css
./docfx/docfx.exe docs/docfx.json

docs/templates/darkerfx/styles/main.css: docs/templates/darkerfx/styles/main.scss
sass $< $(@)

docs-autobuild:
while true; do find docs Makefile src -type f | entr -d bash -c 'scripts/time_it make docs' ; done

Expand Down
10 changes: 10 additions & 0 deletions docs/templates/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>
26 changes: 25 additions & 1 deletion docs/templates/darkerfx/styles/main.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/templates/darkerfx/styles/main.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 31 additions & 1 deletion docs/templates/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 6eccf20

Please sign in to comment.