Skip to content

Commit

Permalink
Highlight the header link to the "current" page
Browse files Browse the repository at this point in the history
  • Loading branch information
ator-dev committed May 14, 2024
1 parent 8d696b4 commit 628abc7
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion files/projects/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<header id="header">
<div class="brand">
<img class="logo-icon" src="/icons/mms.svg">
<h1 class="logo-title"><a href="/">Mark My Search</a></h1>
<h1 class="logo-title"><a href="/" class="current">Mark My Search</a></h1>
</div>
<div class="controls">
<nav>
Expand Down
2 changes: 1 addition & 1 deletion files/stores/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<header id="header">
<div class="brand">
<img class="logo-icon" src="/icons/mms.svg">
<h1 class="logo-title"><a href="/">Mark My Search</a></h1>
<h1 class="logo-title"><a href="/" class="current">Mark My Search</a></h1>
</div>
<div class="controls">
<nav>
Expand Down
22 changes: 19 additions & 3 deletions main.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
--bg-header-D: hsl(300, 30%, 23%);
--border-header-L: hsl(300 100% 88%);
--border-header-D: hsl(300 40% 40%);
--bg-nav-button-L: hsl(0 0% 100%);
--bg-nav-button-D: hsl(0 0% 15%);
--bg-nav-button-L: var(--bg-L);
--bg-nav-button-D: var(--bg-D);
--bg-nav-button-hover-L: var(--bg-header-L);
--bg-nav-button-hover-D: var(--bg-header-D);
--border-nav-button-L: var(--border-header-L);
Expand Down Expand Up @@ -189,11 +189,27 @@ article > .full-width {
border-radius: 0;
}

#header nav a.current::after {
content: "";
position: absolute;
top: calc(100% - 12px);
left: -2px;
height: 23px;
width: 100%;
border-left: 2px solid var(--border-nav-button);
border-right: 2px solid var(--border-nav-button);
background: var(--bg-nav-button);
}

#header nav a:hover {
background: var(--border-nav-button);
}

#header nav a:active {
#header nav a:hover, #header nav a:hover::after {
background: var(--border-nav-button);
}

#header nav a:active, #header nav a:active::after {
background: var(--bg-header);
border-color: var(--bg-header);
}
Expand Down

0 comments on commit 628abc7

Please sign in to comment.