Added prefixes to submavbar links (# for headers, > for pages).

This commit is contained in:
sarah committed 2026-08-30 19:24:24 +02:00
1 parent 46c35689d7
commit cd2759ce4e
2 files changed
+45 -6

No files matched your search

+24 -6
View File
@@ -16,21 +16,39 @@ $SubNavbarCurrent ??= null;
> >
<?php foreach ( <?php foreach (
$SubNavbarItems $SubNavbarItems
as $SubNavbarName => $SubNavbarHref as $Name => $Url
): ?> ): ?>
<?php
$Prefix =
str_starts_with(
$Url,
"#"
)
? "#"
: ">";
?>
<a <a
class="SubNavbarLink" class="SubNavbarLink"
href="<?= htmlspecialchars( href="<?= htmlspecialchars(
$SubNavbarHref, $Url,
ENT_QUOTES, ENT_QUOTES,
"UTF-8" "UTF-8"
) ?>" ) ?>"
<?= $SubNavbarCurrent === $SubNavbarName
? 'aria-current="page"'
: "" ?>
> >
<span
class="SubNavbarPrefix"
aria-hidden="true"
>
<?= htmlspecialchars(
$Prefix,
ENT_QUOTES,
"UTF-8"
) ?>
</span>
<?= htmlspecialchars( <?= htmlspecialchars(
$SubNavbarName, $Name,
ENT_QUOTES, ENT_QUOTES,
"UTF-8" "UTF-8"
) ?> ) ?>
+21
View File
@@ -942,6 +942,27 @@ select {
border: 3px solid var(--Surface2); border: 3px solid var(--Surface2);
} }
.SubNavbarPrefix {
display: inline-block;
min-width: 1rem;
margin-right: 0.25rem;
color: var(--Overlay2);
}
.SubNavbarLink:hover
.SubNavbarPrefix {
color: var(--Sky);
}
.SubNavbarLink[aria-current="location"]
.SubNavbarPrefix,
.SubNavbarLink[aria-current="page"]
.SubNavbarPrefix {
color: var(--Green);
}
@media (max-width: 700px) { @media (max-width: 700px) {
body { body {
grid-template-columns: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr);