Browse Source

Allow HTML in header, make description optional

master v0.0.10
F.W. Dekker 2 years ago
parent
commit
3a04888564
Signed by: FWDekker GPG Key ID: B1B567AF58D6EE0F
  1. 2
      package.json
  2. 11
      src/main/css/common.css
  3. 8
      src/main/js/Template.js

2
package.json

@ -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",

11
src/main/css/common.css

@ -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;

8
src/main/js/Template.js

@ -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…
Cancel
Save