don't show empty sidebar content + animate sidebar

This commit is contained in:
prx 2024-01-12 12:12:53 +01:00
parent 8a70a1cdbb
commit 2dcd4235c8
2 changed files with 7 additions and 9 deletions

View File

@ -6,7 +6,7 @@
#dokuwiki__sidebar {
position: fixed;
top: 0;
left: 0;
left: -110%;
z-index: 99;
overflow-x: hidden;
overflow-y: auto;
@ -19,7 +19,6 @@
text-align:left;
padding: 1em;
margin: 0;
opacity: 0;
visibility: hidden;
transition: 0.5s;
}
@ -39,9 +38,12 @@
border: 1px solid var(--border);
border-radius: var(--standard-border-radius);
}
#dokuwiki__sidebar_content:empty {
display:none;
}
#dokuwiki__sidebar:target {
opacity: 1;
visibility: visible;
left:0;
}
#dokuwiki__breadcrumbs {

View File

@ -60,12 +60,8 @@ $buffer = ob_get_clean();
<a href="#dokuwiki__sidebar_close" id="dokuwiki__sidebar_close_btn" class="button" aria-label="Close">&times;</a>
</div>
<div id="dokuwiki__sidebar_content">
<?php if ($showSidebar): ?>
<?php tpl_includeFile('sidebarheader.html') ?>
<?php tpl_include_page($conf['sidebar'], 1, 1) /* includes the nearest sidebar page */ ?>
<?php tpl_includeFile('sidebarfooter.html') ?>
<?php endif; ?>
<!-- has to be one line to use :empty css selector -->
<div id="dokuwiki__sidebar_content"><?php if ($showSidebar): ?> <?php tpl_includeFile('sidebarheader.html') ?> <?php tpl_include_page($conf['sidebar'], 1, 1) /* includes the nearest sidebar page */ ?> <?php tpl_includeFile('sidebarfooter.html') ?><?php endif; ?>
</div>
<details id="dokuwiki__pagetools" aria-labelledby="dokuwiki__pagetools_heading">