Skip to content

Commit

Permalink
165 : color active link (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathieu414 authored Dec 30, 2023
1 parent 6e38789 commit c767bee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/template/nav.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
<h3 class="nav-title">Intranose</h3>
</li>
<?php foreach ($menu->items as $menu_item): ?>
<li class="<?= $menu_item->url == $_SESSION['current_route'] ? "active" : "" ?>">
<a class="<?= $menu_item == $_SESSION['current_route'] ? "active" : "contrast" ?>"
<li class="<?= strpos($_SESSION['current_route'], $menu_item->url) !== false ? "active" : "" ?>">
<a class="<?= strpos($_SESSION['current_route'], $menu_item->url) !== false ? "active" : "contrast" ?>"
href="<?= $menu_item->url ?>" <?= $menu_item->disableBoost ? 'hx-boost="false"' : '' ?>>
<?php if ($menu_item->icon): ?> <i class="fa fa-fw <?= $menu_item->icon ?>"></i>
<?php endif ?>
Expand Down
5 changes: 4 additions & 1 deletion assets/css/navbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,16 @@ body > main > .spacing-div {
}
.sidenav :is(a, #family-dropdown summary) {
text-decoration: none;
color: var(--contrast);
transition: color var(--transition);
}
.sidenav :is(a, #family-dropdown summary):is(:hover, :focus) {
color: var(--primary);
}

.active > a {
color: var(--primary);
}

@media screen and (min-width: 576px) {
.sidenav.open {
width: 250px;
Expand Down

0 comments on commit c767bee

Please sign in to comment.