From 853752ec5ccc83247fc051f2abe1026c6b69d4cb Mon Sep 17 00:00:00 2001 From: Talon Poole Date: Mon, 15 Feb 2021 23:45:21 +0000 Subject: [PATCH] cause --- html.js | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) 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 `