Browse Source

Move theme-switcher next to sideaffix & fix contribution link hover

pull/988/head
Hsu Still 7 years ago
parent
commit
d075d30afb
No known key found for this signature in database GPG Key ID: 8601A145FDA95209
5 changed files with 46 additions and 19 deletions
  1. +32
    -0
      docs/_template/light-dark-theme/partials/affix.tmpl.partial
  2. +0
    -18
      docs/_template/light-dark-theme/partials/footer.tmpl.partial
  3. +1
    -0
      docs/_template/light-dark-theme/partials/head.tmpl.partial
  4. +4
    -1
      docs/_template/light-dark-theme/styles/dark.css
  5. +9
    -0
      docs/_template/light-dark-theme/styles/theme-switcher.css

+ 32
- 0
docs/_template/light-dark-theme/partials/affix.tmpl.partial View File

@@ -0,0 +1,32 @@
{{!Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE file in the project root for full license information.}}

<div class="hidden-sm col-md-2" role="complementary">
<div class="sideaffix">
<div class="theme-switch-field">
<p>Theme</p>
<select onchange="getSelectionChange(this);" id="theme-switcher">
<option value="theme_dark">Dark</option>
<option value="theme_light">Light</option>
</select>
</div>
{{^_disableContribution}}
<div class="contribution">
<ul class="nav">
{{#docurl}}
<li>
<a href="{{docurl}}" class="contribution-link">{{__global.improveThisDoc}}</a>
</li>
{{/docurl}}
{{#sourceurl}}
<li>
<a href="{{sourceurl}}" class="contribution-link">{{__global.viewSource}}</a>
</li>
{{/sourceurl}}
</ul>
</div>
{{/_disableContribution}}
<nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
<!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
</nav>
</div>
</div>

+ 0
- 18
docs/_template/light-dark-theme/partials/footer.tmpl.partial View File

@@ -1,18 +0,0 @@
{{!Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE file in the project root for full license information.}}

<footer>
<div class="grad-bottom"></div>
<div class="footer">
<div class="container">
<span class="pull-right">
<select onchange="getSelectionChange(this);" id="theme-switcher">
<option value="theme_dark">Dark</option>
<option value="theme_light">Light</option>
</select>
<a href="#top">Back to top</a>
</span>
{{{_appFooter}}}
{{^_appFooter}}<span>Generated by <strong>DocFX</strong></span>{{/_appFooter}}
</div>
</div>
</footer>

+ 1
- 0
docs/_template/light-dark-theme/partials/head.tmpl.partial View File

@@ -14,6 +14,7 @@
<link rel="stylesheet" href="{{_rel}}styles/dark.css" title="theme_dark" >
<link rel="alternate stylesheet" href="{{_rel}}styles/light.css" title="theme_light">
<link rel="stylesheet" href="{{_rel}}styles/main.css">
<link rel="stylesheet" href="{{_rel}}styles/theme-switcher.css">
<link href="//cdn.rawgit.com/noelboss/featherlight/1.7.6/release/featherlight.min.css" type="text/css" rel="stylesheet" />
<meta property="docfx:navrel" content="{{_navRel}}">
<meta property="docfx:tocrel" content="{{_tocRel}}">


+ 4
- 1
docs/_template/light-dark-theme/styles/dark.css View File

@@ -61,7 +61,9 @@ article h4{
.sideaffix{
overflow: visible;
}

.sideaffix > div.contribution > ul > li > a.contribution-link:hover {
background-color: #333333;
}
body .toc{
background-color: inherit;
overflow: visible;
@@ -79,6 +81,7 @@ body .toc{
}
.toc .nav > li.active > a:hover,
.toc .nav > li.active > a:focus {
background-color: #37474F;
color: #4FC3F7;
}



+ 9
- 0
docs/_template/light-dark-theme/styles/theme-switcher.css View File

@@ -0,0 +1,9 @@
div.theme-switch-field {
padding-left: 10px;
padding-bottom: 15px
}

div.theme-switch-field > p{
font-weight: bold;
font-size: 1.2em;
}

Loading…
Cancel
Save