From nobody Sat Jan 29 22:02:34 2022 X-Original-To: dev-commits-doc-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id AC321198EB4E for ; Sat, 29 Jan 2022 22:02:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JmSx64C2vz4tKk; Sat, 29 Jan 2022 22:02:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643493754; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5cCLPd1g06tPz9v57tk09W82CHv9mjM7I0UZ178RpZk=; b=VQY4UQlRc5Ce81Eh3T4v7nk3PC6ivzHKTOen1DyYjkk6zZN99EqSdPWdyutvXxgzmjbum0 RWD7rys1d2iKNvHPFIW/XL8iBmi3EcZEWXmIIpNdKt/9d69ndYLVy+3NZ4yckDRU7AQEMd a9Mw6XK/m1e1/VpnHVJA3C8m790CRsD7YRCaKZbxwi4enr/obSbgNweJAmuRuLYFn+iK2+ 3pDlkxyEjqh8zklTdZGdx/f+4Mm3pdbIdw20XqwqQF5fM0cPpfWJEpnUm55LiTyztnvFpe 4q7cZppORmkUOljNTHZDwGr7tjbV/h5XV34h2SaUfpAGcAAhYdKgVXdMPstLdQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 702D01D6D9; Sat, 29 Jan 2022 22:02:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 20TM2Y6Q014395; Sat, 29 Jan 2022 22:02:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20TM2YXR014394; Sat, 29 Jan 2022 22:02:34 GMT (envelope-from git) Date: Sat, 29 Jan 2022 22:02:34 GMT Message-Id: <202201292202.20TM2YXR014394@gitrepo.freebsd.org> To: doc-committers@FreeBSD.org, dev-commits-doc-all@FreeBSD.org From: Sergio Carlavilla Delgado Subject: git: d62340217c - main - Improve the website for browsers without Javascript enabled List-Id: Commit messages for all branches of the doc repository List-Archive: https://lists.freebsd.org/archives/dev-commits-doc-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-doc-all@freebsd.org X-BeenThere: dev-commits-doc-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: carlavilla X-Git-Repository: doc X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d62340217c0187f57b600a14e35254c0fcac2ee2 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643493754; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5cCLPd1g06tPz9v57tk09W82CHv9mjM7I0UZ178RpZk=; b=w3yFAydPKumVYC193puljJpnq7Uh1J8Ktnf7iE3Q1ctNNaWw8mE+9vO+dmWp0bYnEjVb8Z WVolE8wPoM2IaBvVCxGs8GWb0cvMUaesFbzWJoj8KGfSHsWfrXrFek7kxRAe3kFqxjwlXI WnRsg6bNgNKAfuz/ItRV54H8v3jvbOh0poCZ/b8DY7QDJ4ThLleOkOcaoVUinB+fk+mH3R R+aCh1O1HNwoT8JtEIlkXXpCZ/IZIIWaJKEFZWp9etSO/d5L9kNMhlRL3Rw9W5jw9c6h2q eiNGG3Vw/q1Xk/rs2Zx11HSbwamFsSk9WtxQb+IS2mJec/p6uWhQVXewtUvhew== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1643493754; a=rsa-sha256; cv=none; b=WyuqotT0uoWOfY9Hb998sAg1f5J1f9B7rADyPXsIkMyiCwTSzJVCbTtxdCOm+ZUZsynGX1 qxzakzosubjZNUY1eZCog9J1kyuiSZm6gt750smOTVBKbQK/QsJS9alxw130wfoqCYyvCa Z6xW2FXU/lisb9ScE5LfYBjVW6MV8mRxQd0b48PpxNJ+h5T5hAq4IK/V72Ye0iUexATNzQ XR+rM07nf3O6mMS9zAr1rnWi0XzU7vYjlJtxLcyveRugORyd8ajR+x/K6GsbBaoPIUCCJe qkDbX73yY4KSIkImEPnXjnZwrnvyBuz4Ad4Q+970Bcarn+Po/HGKwVhdkXwpRA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by carlavilla: URL: https://cgit.FreeBSD.org/doc/commit/?id=d62340217c0187f57b600a14e35254c0fcac2ee2 commit d62340217c0187f57b600a14e35254c0fcac2ee2 Author: Sergio Carlavilla Delgado AuthorDate: 2022-01-29 21:58:18 +0000 Commit: Sergio Carlavilla Delgado CommitDate: 2022-01-29 21:58:18 +0000 Improve the website for browsers without Javascript enabled Apply the light theme by default and then change it to the theme selected by the user. This will allow users with a browser with Javascript disabled use the Documentation Portal. Also hide the theme chooser since it uses Javascript to change the theme. In the future the property prefers-color-scheme will be used to change the theme automatically to use the browser theme. PR: 261104 Submitted by: Bob Frazier --- documentation/themes/beastie/assets/js/theme-chooser.js | 6 ++++-- documentation/themes/beastie/assets/styles/footer.scss | 1 + documentation/themes/beastie/layouts/_default/baseof.html | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) 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 @@ -30,7 +30,9 @@ 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'; @@ -47,7 +49,7 @@ 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") { 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 @@ -53,6 +53,7 @@ footer { align-items: center; .theme-container { + display: none; margin-left: 2rem; } 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,5 +1,5 @@ - + {{ partial "site-head.html" . }} {{ block "header" . }}{{ partial "site-header.html" .}}{{ end }}