some more nav fiddling

This commit is contained in:
2025-12-29 09:29:40 -08:00
parent 8d451f8a41
commit c9ef2209b0
3 changed files with 12 additions and 6 deletions

View File

@ -20,19 +20,21 @@ const populateNav = function() {
if (path === "/") home.id = "current-page"; if (path === "/") home.id = "current-page";
nav.append(home); nav.append(home);
let div = document.createElement("div"); let ul = document.createElement("ul");
for (const item of navItems) { for (const item of navItems) {
let li = document.createElement("li");
let a = document.createElement("a"); let a = document.createElement("a");
a.href = item.href; a.href = item.href;
a.innerHTML = item.title; a.innerHTML = item.title;
if (item.href === path) a.id = "current-page"; if (item.href === path) a.id = "current-page";
div.append(a); li.append(a);
ul.append(li);
} }
nav.append(div); nav.append(ul);
} }
populateNav(); populateNav();

View File

@ -102,13 +102,13 @@ a:focus-visible {
} }
p, p,
ul { main ul {
padding: .5rem; padding: .5rem;
background-color: var(--color-alt); background-color: var(--color-alt);
border-radius: 0 0 1rem 1rem; border-radius: 0 0 1rem 1rem;
} }
li { main li {
margin-left: 1rem; margin-left: 1rem;
} }

View File

@ -19,11 +19,15 @@ nav a {
} }
} }
nav div { nav ul {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
} }
nav li {
list-style: none;
}
/* this specifically handles the home button /* this specifically handles the home button
we want it taking up flex container space */ we want it taking up flex container space */
nav > #current-page { nav > #current-page {