From a08d719088c89b1a099d2dda1573ff7338c61046 Mon Sep 17 00:00:00 2001 From: David Lapshin Date: Mon, 27 May 2024 01:33:51 +0300 Subject: [PATCH] Active navbar link indicator 3000 Totally not inspired by Discord --- sass/_nav.scss | 22 ++++++++++++++++++++++ templates/partials/nav.html | 21 ++++++++++++++++++--- 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/sass/_nav.scss b/sass/_nav.scss index 4cb19e2..905bd43 100644 --- a/sass/_nav.scss +++ b/sass/_nav.scss @@ -32,6 +32,7 @@ } a { + position: relative; transition-duration: var(--transition); transition-property: box-shadow, background-color, color, transform; border-radius: 999px; @@ -49,6 +50,27 @@ &:active { transform: scale(var(--active)); } + + &.active { + &:hover::before { + right: 1rem; + left: 1rem; + border-bottom: 0.25rem solid var(--primary-color); + } + + &::before { + display: block; + position: absolute; + right: 1.5rem; + bottom: -0.25rem; + left: 1.5rem; + transition-duration: var(--transition); + transition-property: right, left, border-bottom; + border-bottom: 0.25rem solid var(--fg-muted-2); + border-radius: 999px; + content: ""; + } + } } #main-content { diff --git a/templates/partials/nav.html b/templates/partials/nav.html index b8ca70c..991e5a3 100644 --- a/templates/partials/nav.html +++ b/templates/partials/nav.html @@ -4,16 +4,31 @@ Skip to main content