Allow HTML in header, make description optional
This commit is contained in:
parent
e91c6b6c5a
commit
3a04888564
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@fwdekker/template",
|
"name": "@fwdekker/template",
|
||||||
"version": "0.0.9",
|
"version": "0.0.10",
|
||||||
"description": "The base template for pages on fwdekker.com.",
|
"description": "The base template for pages on fwdekker.com.",
|
||||||
"author": "Felix W. Dekker (https://fwdekker.com)",
|
"author": "Felix W. Dekker (https://fwdekker.com)",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|
|
@ -1,14 +1,17 @@
|
||||||
|
/* Variables */
|
||||||
:root {
|
:root {
|
||||||
--fwdekker-theme-color: #0033cc;
|
--fwdekker-theme-color: #0033cc;
|
||||||
--fwdekker-theme-color-dark: #00279d;
|
--fwdekker-theme-color-dark: #00279d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Base elements */
|
||||||
html {
|
html {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
position: relative;
|
position: relative; /* Required for footer positioning */
|
||||||
min-height: 100%;
|
min-height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,6 +30,12 @@ body {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Custom styling */
|
||||||
|
header .container {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Make arrow next to dropdown visible */
|
/* Make arrow next to dropdown visible */
|
||||||
select {
|
select {
|
||||||
-webkit-appearance: menulist;
|
-webkit-appearance: menulist;
|
||||||
|
|
|
@ -71,15 +71,15 @@ export const nav = function () {
|
||||||
/**
|
/**
|
||||||
* Creates a header element with the given title and description.
|
* Creates a header element with the given title and description.
|
||||||
*
|
*
|
||||||
* @param title {string} the title to display
|
* @param title {string} the title to display, possibly including HTML
|
||||||
* @param description {string} the description to display
|
* @param [description] {string} the description to display, possibly including HTML
|
||||||
* @returns {HTMLElement} a header element
|
* @returns {HTMLElement} a header element
|
||||||
*/
|
*/
|
||||||
export const header = function ({title, description}) {
|
export const header = function ({title, description}) {
|
||||||
return h("header.header",
|
return h("header.header",
|
||||||
h("section.container",
|
h("section.container",
|
||||||
h("h1", title),
|
h("h1", {innerHTML: title}),
|
||||||
h("p", h("em", description))
|
description !== undefined ? h("p", h("em", {innerHTML: description})) : undefined
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue