Allow HTML in header, make description optional
This commit is contained in:
parent
e91c6b6c5a
commit
3a04888564
|
@ -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",
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
)
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue