Allow HTML in header, make description optional

This commit is contained in:
Florine W. Dekker 2020-05-03 23:46:18 +02:00
parent e91c6b6c5a
commit 3a04888564
Signed by: FWDekker
GPG Key ID: B1B567AF58D6EE0F
3 changed files with 15 additions and 6 deletions

View File

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

View File

@ -1,14 +1,17 @@
/* Variables */
:root {
--fwdekker-theme-color: #0033cc;
--fwdekker-theme-color-dark: #00279d;
}
/* Base elements */
html {
height: 100%;
}
body {
position: relative;
position: relative; /* Required for footer positioning */
min-height: 100%;
}
@ -27,6 +30,12 @@ body {
}
/* Custom styling */
header .container {
text-align: center;
}
/* Make arrow next to dropdown visible */
select {
-webkit-appearance: menulist;

View File

@ -71,15 +71,15 @@ export const nav = function () {
/**
* Creates a header element with the given title and description.
*
* @param title {string} the title to display
* @param description {string} the description to display
* @param title {string} the title to display, possibly including HTML
* @param [description] {string} the description to display, possibly including HTML
* @returns {HTMLElement} a header element
*/
export const header = function ({title, description}) {
return h("header.header",
h("section.container",
h("h1", title),
h("p", h("em", description))
h("h1", {innerHTML: title}),
description !== undefined ? h("p", h("em", {innerHTML: description})) : undefined
)
);
};