« get me outta code hell

content, css: generatePageLayout: dynamic sidebar skippers - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-05-30 22:12:58 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-05-31 12:11:59 -0300
commit550da60a1bfabdacd008edb047101347513a187c (patch)
treed0f815d17a76e5fb9c20b3be3375585aada1e09d /src
parent510db039aa51c42b139bf5a1e80a0aef7571cd3d (diff)
content, css: generatePageLayout: dynamic sidebar skippers
Diffstat (limited to 'src')
-rw-r--r--src/content/dependencies/generatePageLayout.js3
-rw-r--r--src/static/css/site.css5
2 files changed, 8 insertions, 0 deletions
diff --git a/src/content/dependencies/generatePageLayout.js b/src/content/dependencies/generatePageLayout.js
index 0a96a19d..e3bfa065 100644
--- a/src/content/dependencies/generatePageLayout.js
+++ b/src/content/dependencies/generatePageLayout.js
@@ -424,8 +424,11 @@ export default {
           (condition === undefined
             ? hasID(id)
             : condition))
+
         .map(({id, string}) =>
           html.tag('span', {class: 'skipper'},
+            {'data-for': id},
+
             html.tag('a',
               {href: `#${id}`},
               language.$('misc.skippers', string))));
diff --git a/src/static/css/site.css b/src/static/css/site.css
index 41145a75..ef697db2 100644
--- a/src/static/css/site.css
+++ b/src/static/css/site.css
@@ -259,6 +259,11 @@ body::before {
   font-weight: 800;
 }
 
+#page-container:not(.showing-sidebar-left) #skippers .skipper[data-for=sidebar-left],
+#page-container:not(.showing-sidebar-right) #skippers .skipper[data-for=sidebar-right] {
+  display: none;
+}
+
 #banner {
   background: black;
   background-color: var(--dim-color);