From 5b97f5a27b8c7e5a83bbfb5b219ff8bd42e9e6a5 Mon Sep 17 00:00:00 2001 From: Jim Carlton Date: Fri, 29 Nov 2024 10:42:59 +1100 Subject: [PATCH 1/2] Updates hover and active states for main navigation --- src/components/main-nav/_main-nav.scss | 45 +++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 4 deletions(-) diff --git a/src/components/main-nav/_main-nav.scss b/src/components/main-nav/_main-nav.scss index a877adfc..0290e688 100644 --- a/src/components/main-nav/_main-nav.scss +++ b/src/components/main-nav/_main-nav.scss @@ -82,9 +82,19 @@ } > li { - @include breakpoint($nsw-desktop-breakpoint) { - &.active { - box-shadow: inset 0 -4px 0 var(--nsw-brand-dark); + @include breakpoint($nsw-desktop-breakpoint) { + a:first-of-type { + position: relative; + } + + &.active > a > span:first-of-type::after { + content: ''; + position: absolute; + bottom: -4px; + left: 0; + width: calc(100%); + height: 2px; + background-color: var(--nsw-brand-accent); } } } @@ -99,7 +109,20 @@ &.active { background-color: var(--nsw-white); - box-shadow: inset 0 -4px 0 var(--nsw-brand-dark); + } + + span:first-of-type { + position: relative; + } + + &.active > span:first-of-type::after { + content: ''; + position: absolute; + bottom: -4px; + left: 0; + width: calc(100%); + height: 2px; + background-color: var(--nsw-brand-accent); } &.active .nsw-material-icons { @@ -135,6 +158,20 @@ &:hover { @include nsw-hover; + + span { + position: relative; + } + + span:first-of-type::after { + content: ''; + position: absolute; + bottom: -4px; + left: 0; + width: calc(100%); + height: 2px; + background-color: var(--nsw-brand-dark); + } } .nsw-material-icons { From f45019e581132b1cea82f32ef1597705e16b6ae2 Mon Sep 17 00:00:00 2001 From: Jim Carlton Date: Thu, 12 Dec 2024 13:05:45 +1100 Subject: [PATCH 2/2] Adjusts hover and active state styling for second round of revision --- src/components/main-nav/_main-nav.scss | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/main-nav/_main-nav.scss b/src/components/main-nav/_main-nav.scss index 0290e688..414f45cf 100644 --- a/src/components/main-nav/_main-nav.scss +++ b/src/components/main-nav/_main-nav.scss @@ -90,11 +90,11 @@ &.active > a > span:first-of-type::after { content: ''; position: absolute; - bottom: -4px; + bottom: 0; left: 0; width: calc(100%); height: 2px; - background-color: var(--nsw-brand-accent); + background-color: var(--nsw-brand-dark); } } } @@ -118,11 +118,11 @@ &.active > span:first-of-type::after { content: ''; position: absolute; - bottom: -4px; + bottom: 0; left: 0; width: calc(100%); height: 2px; - background-color: var(--nsw-brand-accent); + background-color: var(--nsw-brand-dark); } &.active .nsw-material-icons { @@ -166,7 +166,7 @@ span:first-of-type::after { content: ''; position: absolute; - bottom: -4px; + bottom: 0; left: 0; width: calc(100%); height: 2px;