From 04095848c288973d849ef672ac51b99ab69a4855 Mon Sep 17 00:00:00 2001 From: "Florine W. Dekker" Date: Sat, 19 Nov 2022 13:35:14 +0100 Subject: [PATCH] Resolve issues with nav size, add toc, etc. --- src/main/css/snippets/common.css | 57 +++++++++++++++++--------------- src/main/css/snippets/nav.css | 11 +++--- src/main/js/template.js | 15 +++++---- src/test/index.html | 34 +++++++++++-------- 4 files changed, 65 insertions(+), 52 deletions(-) diff --git a/src/main/css/snippets/common.css b/src/main/css/snippets/common.css index a268c9a..74ca9e5 100644 --- a/src/main/css/snippets/common.css +++ b/src/main/css/snippets/common.css @@ -1,5 +1,5 @@ /* External link icon */ -a.external::after { +a[target="_blank"]::after { display: inline-block; width: 0.7em; @@ -18,12 +18,39 @@ a.external::after { } +/* Hide anything */ +.hidden { + display: none !important; +} + +/* Input with button next to it */ +.input-with-button { + display: flex; +} + +.input-with-button > *:first-child { + border-top-right-radius: 0; + border-bottom-right-radius: 0; +} + +.input-with-button > *:not(:first-child) { + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} + +/* Container with table of contents */ +.container-with-toc { + display: grid; + grid-template-columns: 200px auto; +} + + /* Noscript */ -noscript.fwd-jsNotice img { +noscript.fwd-js-notice img { position: absolute; } -noscript.fwd-jsNotice p { +noscript.fwd-js-notice p { font-weight: bold; text-align: center; } @@ -35,30 +62,6 @@ header.fwd-header h1 > a { } -/* Generic classes */ -.hidden { - display: none !important; -} - -.inputWithButton { - display: flex; -} - -.inputWithButton > *:first-child { - border-top-right-radius: 0; - border-bottom-right-radius: 0; -} - -.inputWithButton > *:not(:first-child) { - border-top-left-radius: 0; - border-bottom-left-radius: 0; -} - -#fwd-toc { - position: fixed; -} - - /* Footer */ footer.fwd-footer #fwd-footer-version { float: right; diff --git a/src/main/css/snippets/nav.css b/src/main/css/snippets/nav.css index 21f49e4..4b250b1 100644 --- a/src/main/css/snippets/nav.css +++ b/src/main/css/snippets/nav.css @@ -1,5 +1,6 @@ /* Base elements */ nav.fwd-nav { + display: block; z-index: 10; margin: 0; @@ -7,7 +8,6 @@ nav.fwd-nav { background-color: var(--fwdekker-theme-color); border-bottom: 1px solid #cccccc; - font-size: 120%; --padding: calc(2em / 3); } @@ -41,11 +41,9 @@ nav.fwd-nav #nav-hamburger-label { nav.fwd-nav #nav-hamburger-label { float: right; - font-size: unset; - cursor: pointer; } -nav.fwd-nav a.external::after { +nav.fwd-nav a[target="_blank"]::after { background-color: white; } @@ -67,6 +65,7 @@ nav.fwd-nav div.logo { /* First level nesting */ nav.fwd-nav ul { + display: block; margin: 0; padding: 0; @@ -127,13 +126,13 @@ nav.fwd-nav input[type="checkbox"] { display: none; } -@media (min-width: 600px) { +@media (min-width: 576px) { nav.fwd-nav #nav-hamburger-label { display: none; } } -@media (max-width: 600px) { +@media (max-width: 576px) { nav.fwd-nav input[type="checkbox"]:not(:checked) ~ ul li:not(:first-child) { display: none; } diff --git a/src/main/js/template.js b/src/main/js/template.js index 5f2d9a6..6fa5729 100644 --- a/src/main/js/template.js +++ b/src/main/js/template.js @@ -172,18 +172,21 @@ const footer = function( }) { if (author === undefined) author = "Florine W. Dekker"; if (authorURL === undefined) authorURL = "https://fwdekker.com/"; - if (license === undefined) license = "MIT License"; + if (license === undefined) license = "MIT"; if (licenseURL === undefined && vcsURL !== undefined) licenseURL = `${vcsURL}src/branch/master/LICENSE`; if (vcs === undefined && vcsURL !== undefined) vcs = "git"; if (privacyPolicyURL === undefined) privacyPolicyURL = "https://fwdekker.com/privacy/"; return stringToHtml( - `