Remove unnecessary element classes

This commit is contained in:
Florine W. Dekker 2021-04-16 12:39:28 +02:00
parent 68b5d33f54
commit b7c21ad319
Signed by: FWDekker
GPG Key ID: B1B567AF58D6EE0F
4 changed files with 32 additions and 32 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@fwdekker/template",
"version": "1.0.2",
"version": "1.0.3",
"description": "The base template for pages on fwdekker.com.",
"author": "Felix W. Dekker",
"license": "MIT",

View File

@ -24,12 +24,12 @@ body {
margin-bottom: 5rem;
}
.footer {
footer {
margin-bottom: 3rem;
}
/* Custom styling */
/* Override Milligram */
header .container {
text-align: center;
}

View File

@ -1,4 +1,4 @@
.nav {
nav {
margin: 0;
width: 100%;
@ -8,12 +8,12 @@
--padding: calc(2em / 3);
}
.nav * {
nav * {
z-index: 10;
vertical-align: middle;
}
.nav a {
nav a {
display: inline-block;
margin: 0;
padding: calc(var(--padding)) calc(var(--padding));
@ -23,27 +23,27 @@
}
.nav .logo {
nav .logo {
width: calc(1em + var(--padding));
height: calc(1em + var(--padding));
vertical-align: middle;
filter: brightness(0) invert(1);
}
.nav div.logo {
nav div.logo {
display: inline-block;
margin-right: calc(1em / 3);
}
.nav ul {
nav ul {
margin: 0;
padding: 0;
list-style: none;
}
.nav ul li {
nav ul li {
display: inline-block;
margin: 0;
padding: 0;
@ -52,35 +52,35 @@
background-color: var(--fwdekker-theme-color);
}
.nav ul li:hover,
.nav ul li:focus-within {
nav ul li:hover,
nav ul li:focus-within {
cursor: pointer;
background-color: var(--fwdekker-theme-color-very-dark);
}
.nav li.currentPage {
nav li.currentPage {
background-color: var(--fwdekker-theme-color-dark);
}
.nav ul li ul {
nav ul li ul {
display: none;
position: absolute;
left: 0;
}
.nav ul li ul li ul {
nav ul li ul li ul {
left: 100%;
top: 0;
}
.nav ul li:hover > ul,
.nav ul li:focus-within > ul,
.nav ul li ul:hover {
nav ul li:hover > ul,
nav ul li:focus-within > ul,
nav ul li ul:hover {
display: block;
}
.nav ul li ul li {
nav ul li ul li {
min-width: 7em;
width: 100%;
white-space: nowrap;

View File

@ -6,7 +6,7 @@
* @returns {HTMLElement} the HTML element described by the given string
*/
const stringToHtml = function(string, query) {
return new DOMParser().parseFromString(string, "text/html").body.querySelector(query);
return (new DOMParser()).parseFromString(string, "text/html").body.querySelector(query);
}
/**
@ -68,7 +68,7 @@ const nav = function (highlightPath = "") {
return [];
});
const nav = stringToHtml(`<nav class="nav"></nav>`, "nav");
const nav = stringToHtml(`<nav></nav>`, "nav");
nav.appendChild(base);
return nav;
};
@ -110,10 +110,10 @@ const unpackEntry = function (entry, path = "/", highlightPath = "") {
*/
const header = function({title, description}) {
if (title === undefined && description === undefined)
return stringToHtml(`<header class="header"></header>`, "header");
return stringToHtml(`<header></header>`, "header");
return stringToHtml(
`<header class="header"><section class="container">` +
`<header><section class="container">` +
(title !== undefined ? `<h1>${title}</h1>` : "") +
(description !== undefined ? `<p><em>${description}</em></p>` : "") +
`</section></header>`,
@ -157,7 +157,7 @@ const footer = function (
if (privacyPolicyURL === undefined) privacyPolicyURL = "https://fwdekker.com/privacy/";
return stringToHtml(
`<footer class="footer"><section class="container">` +
`<footer><section class="container">` +
footerLink("Made by ", author, authorURL, ". ") +
footerLink("Licensed under the ", license, licenseURL, ". ") +
footerLink("Source code available on ", vcs, vcsURL, ". ") +