From 983f92c1e74cfcf652a90ead5035e340d7756b4f Mon Sep 17 00:00:00 2001 From: Dan Allen Date: Wed, 7 Feb 2024 03:42:22 -0700 Subject: [PATCH] import changes from Antora default UI through https://gitlab.com/antora/antora-ui-default/-/commit/8d5bb9cedc46f58198d3cd7afd67cf472a024777 * ensure discrete headings are not included in page TOC * tweak spacing between items in explore panel; add hanging indent for wrapped titles * enclose component title in div in navigation explore panel * use tighter line height for component title in explore panel --- ui/preview-src/index.adoc | 3 +++ ui/src/css/nav.css | 9 +++++---- ui/src/js/02-on-this-page.js | 2 +- ui/src/partials/nav-explore.hbs | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ui/preview-src/index.adoc b/ui/preview-src/index.adoc index 86e043e..7f1fae4 100644 --- a/ui/preview-src/index.adoc +++ b/ui/preview-src/index.adoc @@ -297,6 +297,9 @@ Eu mea inani iriure. [discrete] == Voluptua singulis +[discrete] +=== Nominavi luptatum + Cum dicat putant ne. Est in reque homero principes, meis deleniti mediocrem ad has. Ex nam suas nemore dignissim, vel apeirian democritum et. diff --git a/ui/src/css/nav.css b/ui/src/css/nav.css index a00ada1..807a9fc 100644 --- a/ui/src/css/nav.css +++ b/ui/src/css/nav.css @@ -222,11 +222,11 @@ } .nav-panel-explore .components { - line-height: var(--doc-line-height); + line-height: var(--nav-line-height); flex-grow: 1; box-shadow: inset 0 1px 5px var(--nav-panel-divider-color); background: var(--nav-secondary-background); - padding: 0.5rem 0.75rem 0 0.75rem; + padding: 0.75rem 0.75rem 0 0.75rem; margin: 0; overflow-y: scroll; overscroll-behavior: none; @@ -243,7 +243,7 @@ } .nav-panel-explore .component + .component { - margin-top: 0.5rem; + margin-top: 0.75rem; } .nav-panel-explore .component:last-child { @@ -252,13 +252,14 @@ .nav-panel-explore .component .title { font-weight: var(--body-font-weight-bold); + text-indent: 0.375rem hanging; } .nav-panel-explore .versions { display: flex; flex-wrap: wrap; padding-left: 0; - margin: -0.25rem -0.375rem 0 0.375rem; + margin: -0.125rem -0.375rem 0 0.375rem; line-height: 1; list-style: none; } diff --git a/ui/src/js/02-on-this-page.js b/ui/src/js/02-on-this-page.js index 12938e6..f3b2732 100644 --- a/ui/src/js/02-on-this-page.js +++ b/ui/src/js/02-on-this-page.js @@ -15,7 +15,7 @@ var headingSelector = [articleSelector] if (level) { for (var l = 1; l <= level; l++) headingSelector.push((l === 2 ? '.sectionbody>' : '') + '.sect' + l) - headingSelector.push('h' + (level + 1) + '[id]') + headingSelector.push('h' + (level + 1) + '[id]' + (level > 1 ? ':not(.discrete)' : '')) } else { headingSelector.push('h1[id].sect0') } diff --git a/ui/src/partials/nav-explore.hbs b/ui/src/partials/nav-explore.hbs index 8989c1a..33d4f72 100644 --- a/ui/src/partials/nav-explore.hbs +++ b/ui/src/partials/nav-explore.hbs @@ -9,7 +9,7 @@ {{#each site.components}} {{#if (and (ne ./name 'ROOT') (ne ./name 'docs'))}}
  • - {{{./title}}} + {{#if (or ./versions.[1] ./versions.[0].version (ne ./versions.[0].displayVersion 'default'))}}