Rework header bar
This commit is contained in:
@@ -6,9 +6,10 @@ This is a fork of the original default dokuwiki template.
|
||||
## Changes from the original template
|
||||
- Default font changed to "Perfect DOS VGA 437 Win"
|
||||
- Enhanced header search with DokuWiki quicksearch suggestions, keyboard navigation, and disabled browser autofill
|
||||
- Desktop header condensed into a single status-bar-style row with inline breadcrumbs and a three-dot tools menu
|
||||
|
||||
## Icon theming (light/dark)
|
||||
- Header tool icons (user tools and site tools) are rendered as inline SVG.
|
||||
- Header tool icons (user tools and site tools inside the desktop three-dot menu) are rendered as inline SVG.
|
||||
- The pagetools footer is intentionally text-only (no icons).
|
||||
- Icon color is controlled through `@ini_icons` (placeholder `__icons__`) in [replacements] inside `style.ini`.
|
||||
- Hover/active icon color follows `@ini_link` to match link interaction color.
|
||||
|
||||
248
css/design.less
248
css/design.less
@@ -15,45 +15,53 @@
|
||||
********************************************************************/
|
||||
|
||||
#dokuwiki__header {
|
||||
padding: 2em 0 1.5em;
|
||||
padding: 0;
|
||||
border-bottom: 1px solid @ini_border;
|
||||
margin-bottom: .35em;
|
||||
|
||||
.headings,
|
||||
.tools {
|
||||
margin-bottom: 1.5em;
|
||||
width: 49%;
|
||||
.pad {
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
.tools {
|
||||
margin-top: .2em;
|
||||
|
||||
.header__bar {
|
||||
height: 34px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.headings {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 1em;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.logo {
|
||||
margin: 0;
|
||||
font-size: 1.5em;
|
||||
font-size: 1em;
|
||||
font-weight: normal;
|
||||
line-height: 1.2;
|
||||
line-height: 1;
|
||||
flex: 0 0 auto;
|
||||
|
||||
a {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: .5em;
|
||||
text-decoration: none;
|
||||
color: @ini_text;
|
||||
background-color: inherit;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
img {
|
||||
float: left;
|
||||
margin-right: .5em;
|
||||
height: 64px;
|
||||
display: block;
|
||||
height: 1.5em;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
span {
|
||||
display: block;
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: @ini_text;
|
||||
background-color: inherit;
|
||||
}
|
||||
}
|
||||
|
||||
p.claim {
|
||||
margin-bottom: 0;
|
||||
font-size: 0.875em;
|
||||
}
|
||||
|
||||
/* make all links in header (including breadcrumb and interwiki) same colour as the rest */
|
||||
@@ -64,8 +72,7 @@
|
||||
}
|
||||
|
||||
[dir=rtl] #dokuwiki__header .logo img {
|
||||
float: right;
|
||||
margin-left: .5em;
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
@@ -87,17 +94,15 @@
|
||||
}
|
||||
|
||||
#dokuwiki__header .tools {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
gap: .5em;
|
||||
min-width: 0;
|
||||
|
||||
ul {
|
||||
padding-left: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
li {
|
||||
font-size: 0.875em;
|
||||
margin-left: 1em;
|
||||
list-style: none;
|
||||
display: inline;
|
||||
vertical-align: top;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
form.search div.ajax_qsearch li {
|
||||
@@ -109,9 +114,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
[dir=rtl] #dokuwiki__header .tools li {
|
||||
margin-right: 1em;
|
||||
margin-left: 0;
|
||||
[dir=rtl] #dokuwiki__header .tools {
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
#dokuwiki__header .mobileTools {
|
||||
@@ -122,9 +126,31 @@
|
||||
|
||||
#dokuwiki__sitetools {
|
||||
text-align: right;
|
||||
position: relative;
|
||||
white-space: nowrap;
|
||||
|
||||
form.search {
|
||||
font-size: 0.875em;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
> form.search {
|
||||
flex: 0 1 auto;
|
||||
}
|
||||
|
||||
> form.search input {
|
||||
width: 14em;
|
||||
max-width: 100%;
|
||||
height: 24px;
|
||||
margin: 0;
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
> form.search div.ajax_qsearch {
|
||||
min-width: 18em;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,33 +195,137 @@ form.search {
|
||||
|
||||
/*____________ breadcrumbs ____________*/
|
||||
|
||||
.dokuwiki div.breadcrumbs {
|
||||
border-top: 1px solid @ini_border;
|
||||
border-bottom: 1px solid @ini_background;
|
||||
margin-bottom: .5em;
|
||||
.dokuwiki #dokuwiki__header div.breadcrumbs {
|
||||
border: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-size: 0.875em;
|
||||
clear: both;
|
||||
clear: none;
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
flex: 1 1 auto;
|
||||
|
||||
div {
|
||||
padding: .1em .35em;
|
||||
}
|
||||
|
||||
div:only-child {
|
||||
border-top: 1px solid @ini_background;
|
||||
border-bottom: 1px solid @ini_border;
|
||||
}
|
||||
|
||||
div:first-child {
|
||||
border-top: 1px solid @ini_background;
|
||||
}
|
||||
|
||||
div:last-child {
|
||||
border-bottom: 1px solid @ini_border;
|
||||
padding: 0;
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.bcsep {
|
||||
font-size: 0.75em;
|
||||
}
|
||||
|
||||
.bchead {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
margin: -1px;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
clip: rect(0, 0, 0, 0);
|
||||
border: 0;
|
||||
}
|
||||
}
|
||||
|
||||
#dokuwiki__header {
|
||||
.header__menu {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex: 0 0 auto;
|
||||
height: 24px;
|
||||
margin: 0;
|
||||
|
||||
summary {
|
||||
list-style: none;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 1px solid @ini_border;
|
||||
background-color: @ini_background;
|
||||
color: @ini_text;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
border-radius: 2px;
|
||||
box-sizing: border-box;
|
||||
line-height: 1;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
summary::-webkit-details-marker {
|
||||
display: none;
|
||||
}
|
||||
|
||||
summary span {
|
||||
font-size: 18px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
&[open] summary,
|
||||
summary:hover,
|
||||
summary:focus {
|
||||
border-color: @ini_link;
|
||||
color: @ini_link;
|
||||
}
|
||||
}
|
||||
|
||||
.header__menu-panel {
|
||||
position: absolute;
|
||||
top: calc(100% + .3em);
|
||||
right: 0;
|
||||
min-width: 14em;
|
||||
padding: .35em 0;
|
||||
background-color: @ini_background;
|
||||
border: 1px solid @ini_border;
|
||||
box-shadow: 0 .25em .75em fade(@ini_text, 15%);
|
||||
z-index: 30;
|
||||
white-space: normal;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.header__menu-list {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
li {
|
||||
margin: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
li.action a {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: .5em;
|
||||
padding: .35em .75em;
|
||||
font-size: .875em;
|
||||
color: @ini_text;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
li.action a:hover,
|
||||
li.action a:focus {
|
||||
background-color: @ini_background_alt;
|
||||
color: @ini_link;
|
||||
}
|
||||
}
|
||||
|
||||
.header__menu-separator {
|
||||
margin: .35em .75em;
|
||||
border-top: 1px solid @ini_border;
|
||||
}
|
||||
}
|
||||
|
||||
[dir=rtl] #dokuwiki__header .header__menu-panel {
|
||||
left: 0;
|
||||
right: auto;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
/* sidebar
|
||||
@@ -272,9 +402,9 @@ form.search {
|
||||
float: right;
|
||||
margin-right: -1em;
|
||||
margin-bottom: -1px;
|
||||
margin-top: -1.5em;
|
||||
margin-top: 0;
|
||||
overflow: hidden;
|
||||
padding: 0.5em 1em 0;
|
||||
padding: 0 1em 0;
|
||||
|
||||
span {
|
||||
font-size: 0.875em;
|
||||
|
||||
@@ -200,18 +200,31 @@ body {
|
||||
width: auto;
|
||||
margin-bottom: .5em;
|
||||
}
|
||||
#dokuwiki__header .header__bar {
|
||||
display: block;
|
||||
height: auto;
|
||||
}
|
||||
[dir=rtl] #dokuwiki__header .headings,
|
||||
[dir=rtl] #dokuwiki__header .tools {
|
||||
float: none;
|
||||
text-align: right;
|
||||
width: auto;
|
||||
}
|
||||
#dokuwiki__header .headings {
|
||||
display: block;
|
||||
}
|
||||
#dokuwiki__header .headings .logo a {
|
||||
display: inline-flex;
|
||||
}
|
||||
#dokuwiki__sitetools {
|
||||
text-align: left;
|
||||
}
|
||||
[dir=rtl] #dokuwiki__sitetools {
|
||||
text-align: right;
|
||||
}
|
||||
#dokuwiki__header .header__menu {
|
||||
display: none;
|
||||
}
|
||||
#dokuwiki__usertools,
|
||||
#dokuwiki__sitetools ul,
|
||||
#dokuwiki__sitetools h3,
|
||||
|
||||
@@ -20,25 +20,26 @@ body {
|
||||
#dokuwiki__header {
|
||||
width: 100%;
|
||||
|
||||
.header__bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: .75em;
|
||||
}
|
||||
|
||||
.headings {
|
||||
float: left;
|
||||
flex: 1 1 auto;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.tools {
|
||||
float: right;
|
||||
text-align: right;
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
}
|
||||
|
||||
[dir=rtl] #dokuwiki__header {
|
||||
.headings {
|
||||
float: right;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.tools {
|
||||
float: left;
|
||||
text-align: left;
|
||||
.header__bar {
|
||||
flex-direction: row-reverse;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,49 +1,27 @@
|
||||
#dokuwiki__usertools {
|
||||
position: absolute;
|
||||
top: .5em;
|
||||
right: 40px; // pagetool width
|
||||
text-align: right;
|
||||
width: 100%;
|
||||
|
||||
ul {
|
||||
margin: 0 auto;
|
||||
padding: 0;
|
||||
#dokuwiki__header {
|
||||
#dokuwiki__usertools {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
li.action a {
|
||||
display: inline-flex;
|
||||
flex-direction: row-reverse;
|
||||
flex-wrap: nowrap;
|
||||
|
||||
.header__menu-list li.action a {
|
||||
svg {
|
||||
height: 1.4em;
|
||||
width: 1.4em;
|
||||
height: 1.1em;
|
||||
width: 1.1em;
|
||||
flex: 0 0 auto;
|
||||
vertical-align: middle;
|
||||
fill: @ini_icons;
|
||||
margin-right: 0.2em;
|
||||
}
|
||||
}
|
||||
|
||||
li.action a:hover,
|
||||
li.action a:active {
|
||||
svg {
|
||||
.header__menu-list li.action a:hover svg,
|
||||
.header__menu-list li.action a:focus svg,
|
||||
.header__menu-list li.action a:active svg {
|
||||
fill: @ini_link;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[dir=rtl] #dokuwiki__usertools {
|
||||
text-align: left;
|
||||
left: 40px; // pagetool width
|
||||
right: auto;
|
||||
|
||||
|
||||
li.action a {
|
||||
|
||||
svg {
|
||||
margin-right: 0;
|
||||
margin-left: 0.2em;
|
||||
}
|
||||
[dir=rtl] #dokuwiki__header {
|
||||
#dokuwiki__usertools {
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,20 @@
|
||||
|
||||
// must be run from within DokuWiki
|
||||
if (!defined('DOKU_INC')) die();
|
||||
|
||||
$siteToolsHtml = (new \dokuwiki\Menu\SiteMenu())->getListItems('action ');
|
||||
$userToolsHtml = '';
|
||||
if ($conf['useacl']) {
|
||||
$userToolsHtml = (new \dokuwiki\Menu\UserMenu())->getListItems('action ');
|
||||
}
|
||||
|
||||
$breadcrumbsHtml = '';
|
||||
if ($conf['youarehere']) {
|
||||
$breadcrumbsHtml = tpl_youarehere(null, true);
|
||||
}
|
||||
if (!$breadcrumbsHtml && $conf['breadcrumbs']) {
|
||||
$breadcrumbsHtml = tpl_breadcrumbs(null, true);
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- ********** HEADER ********** -->
|
||||
@@ -13,11 +27,12 @@ if (!defined('DOKU_INC')) die();
|
||||
|
||||
<?php tpl_includeFile('header.html') ?>
|
||||
|
||||
<div class="headings group">
|
||||
<ul class="a11y skip">
|
||||
<li><a href="#dokuwiki__content"><?php echo $lang['skip_to_content']; ?></a></li>
|
||||
</ul>
|
||||
|
||||
<div class="header__bar">
|
||||
<div class="headings header__brand">
|
||||
<h1 class="logo"><?php
|
||||
// get logo either out of the template images folder or data/media folder
|
||||
$logoSize = [];
|
||||
@@ -35,54 +50,50 @@ if (!defined('DOKU_INC')) die();
|
||||
'accesskey="h" title="' . tpl_getLang('home') . ' [h]"'
|
||||
);
|
||||
?></h1>
|
||||
<?php if ($conf['tagline']) : ?>
|
||||
<p class="claim"><?php echo $conf['tagline']; ?></p>
|
||||
|
||||
<?php if ($breadcrumbsHtml) : ?>
|
||||
<div class="breadcrumbs header__breadcrumbs"><?php echo $bread crumbsHtml; ?></div>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
|
||||
<div class="tools group">
|
||||
<!-- USER TOOLS -->
|
||||
<?php if ($conf['useacl']) : ?>
|
||||
<div id="dokuwiki__sitetools" class="tools header__actions">
|
||||
<h3 class="a11y"><?php echo $lang['site_tools']; ?></h3>
|
||||
<?php tpl_searchform(true, false); ?>
|
||||
|
||||
<?php if ($siteToolsHtml || $userToolsHtml) : ?>
|
||||
<details class="header__menu">
|
||||
<summary aria-label="<?php echo hsc($lang['tools']); ?>" title="<?php echo hsc($lang['tools']); ?>">
|
||||
<span aria-hidden="true">⋮</span>
|
||||
</summary>
|
||||
|
||||
<div class="header__menu-panel">
|
||||
<?php if ($siteToolsHtml) : ?>
|
||||
<ul class="header__menu-list header__menu-list--site">
|
||||
<?php echo $siteToolsHtml; ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if ($siteToolsHtml && $userToolsHtml) : ?>
|
||||
<div class="header__menu-separator" role="separator"></div>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if ($userToolsHtml) : ?>
|
||||
<div id="dokuwiki__usertools">
|
||||
<h3 class="a11y"><?php echo $lang['user_tools']; ?></h3>
|
||||
<ul>
|
||||
<?php
|
||||
if (!empty($_SERVER['REMOTE_USER'])) {
|
||||
echo '<li class="user">';
|
||||
tpl_userinfo(); /* 'Logged in as ...' */
|
||||
echo '</li>';
|
||||
}
|
||||
echo (new \dokuwiki\Menu\UserMenu())->getListItems('action ');
|
||||
?>
|
||||
<ul class="header__menu-list header__menu-list--user">
|
||||
<?php echo $userToolsHtml; ?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
</details>
|
||||
<?php endif ?>
|
||||
|
||||
<!-- SITE TOOLS -->
|
||||
<div id="dokuwiki__sitetools">
|
||||
<h3 class="a11y"><?php echo $lang['site_tools']; ?></h3>
|
||||
<?php tpl_searchform(true, false); ?>
|
||||
<div class="mobileTools">
|
||||
<?php echo (new \dokuwiki\Menu\MobileMenu())->getDropdown($lang['tools']); ?>
|
||||
</div>
|
||||
<ul>
|
||||
<?php echo (new \dokuwiki\Menu\SiteMenu())->getListItems('action '); ?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- BREADCRUMBS -->
|
||||
<?php if ($conf['breadcrumbs'] || $conf['youarehere']) : ?>
|
||||
<div class="breadcrumbs">
|
||||
<?php if ($conf['youarehere']) : ?>
|
||||
<div class="youarehere"><?php tpl_youarehere() ?></div>
|
||||
<?php endif ?>
|
||||
<?php if ($conf['breadcrumbs']) : ?>
|
||||
<div class="trace"><?php tpl_breadcrumbs() ?></div>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<hr class="a11y" />
|
||||
</div></header><!-- /header -->
|
||||
|
||||
Reference in New Issue
Block a user