diff --git a/html.js b/html.js index 0a5e89c..3fa75c4 100644 --- a/html.js +++ b/html.js @@ -20,6 +20,17 @@ export function toHTML(gemtext, options) { const truncate = (text, limit) => text.length > limit ? `${text.substring(0, limit)}...` : text; + function overrideStyles(options) { + if (options.css !== "full") return ""; + const vars = CSS.rootVariables(CSS.FULL); + + return Object.keys(vars).reduce((styles, key) => { + if (options[key] && options[key] !== vars[key]) + styles += `--${key}: ${options[key]};`; + return styles; + }, ""); + } + return ` { - if (options[key] && options[key] !== vars[key]) styles += `--${key}: ${options[key]};`; - return styles; - }, ""); -} - export function head(options) { return `