diff --git a/documentation/themes/beastie/assets/js/theme-chooser.js b/documentation/themes/beastie/assets/js/theme-chooser.js index a05b17ff37..9a48432dc5 100644 --- a/documentation/themes/beastie/assets/js/theme-chooser.js +++ b/documentation/themes/beastie/assets/js/theme-chooser.js @@ -1,63 +1,65 @@ /* BSD 2-Clause License Copyright (c) 2001-2022, The FreeBSD Documentation Project Copyright (c) 2021-2022, Sergio Carlavilla All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ (function () { var theme = localStorage.getItem('theme'); var themeChooser = document.querySelector('#theme-chooser'); - + var themeContainer = document.querySelector('.theme-container'); + themeContainer.style.display = "block"; + if (theme === "theme-dark") { setTheme('theme-dark'); themeChooser.value = 'theme-dark'; } else if (theme === "theme-high-contrast") { setTheme('theme-high-contrast'); themeChooser.value = 'theme-high-contrast'; } else { setTheme('theme-light'); themeChooser.value = 'theme-light'; } })(); var themeChooser = document.querySelector('#theme-chooser'); themeChooser.addEventListener('change', function() { var theme = this.value; - + if (theme === "theme-dark") { setTheme('theme-dark'); } else if (theme === "theme-high-contrast") { setTheme('theme-high-contrast'); } else { setTheme('theme-light'); } }); function setTheme(themeName) { localStorage.setItem('theme', themeName); document.documentElement.className = themeName; } diff --git a/documentation/themes/beastie/assets/styles/footer.scss b/documentation/themes/beastie/assets/styles/footer.scss index 1a90d44669..bda42d5f7a 100644 --- a/documentation/themes/beastie/assets/styles/footer.scss +++ b/documentation/themes/beastie/assets/styles/footer.scss @@ -1,164 +1,165 @@ /* * Copyright (c) 2001-2022, The FreeBSD Documentation Project * Copyright (c) 2021-2022, Sergio Carlavilla * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * */ footer { display: flex; flex-flow: row wrap; padding: 30px 20px 20px 20px; color: var(--global-font-color); background-color: var(--footer-background); border-top: 1px solid var(--footer-border-color); align-items: center; > * { flex: 1 100%; } .footer-project-language { margin-right: 1.25em; margin-bottom: 2em; h1 { font-weight: bolder; font-size: 1.5rem; } .options-container { display: flex; align-items: center; .theme-container { + display: none; margin-left: 2rem; } .language-container { display: flex; align-items: center; a { display: flex; align-items: center; text-decoration: none; color: var(--global-font-color); border-radius: 1px; padding: .3rem; img { display: inline-flex; padding-right: 10px; align-items: center; justify-content: center; height: 1.5rem; width: 1.5rem; } } } } } .footer-nav { display: flex; list-style: none; margin: 0; padding: 0; > * { flex: 1 50%; margin-right: 1.25em; } .title { font-weight: bolder; font-size: 15px; border-bottom: 1px solid var(--white); } h2 { border: none !important; } ul { list-style: none; padding-left: 0; li { line-height: 2em; a { text-decoration: none; color: var(--global-font-color); } } } } .copyright { display: flex; flex-wrap: wrap; color: var(--global-font-color); .love { display: flex; align-items: center; font-weight: bolder; .heart { color: red; } } } } @media screen and (min-width: 24rem) { .copyright .love { margin-left: auto; } } @media screen and (min-width: 40rem) { .footer-project-language { flex: 1 0px; } .footer-nav > * { flex: 1; } .footer-nav { flex: 2 0px; } } @media screen and (max-width: 41rem) { .footer-nav { display: block !important; } } diff --git a/documentation/themes/beastie/layouts/_default/baseof.html b/documentation/themes/beastie/layouts/_default/baseof.html index c72cb86a3a..9ad1667a73 100644 --- a/documentation/themes/beastie/layouts/_default/baseof.html +++ b/documentation/themes/beastie/layouts/_default/baseof.html @@ -1,9 +1,9 @@ - + {{ partial "site-head.html" . }} {{ block "header" . }}{{ partial "site-header.html" .}}{{ end }} {{ block "main" . }}{{ end }} {{ block "footer" . }}{{ partial "site-footer.html" .}}{{ end }}