From f400a43640e7106d181d55365a9617c3d12e5891 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Fri, 29 Dec 2023 22:59:20 -0400 Subject: content: misc content syntax cleanup, mostly attribute merging --- src/content/dependencies/generateContentHeading.js | 36 ++++++++++------------ 1 file changed, 17 insertions(+), 19 deletions(-) (limited to 'src/content/dependencies/generateContentHeading.js') diff --git a/src/content/dependencies/generateContentHeading.js b/src/content/dependencies/generateContentHeading.js index 0343409c..57bacbe5 100644 --- a/src/content/dependencies/generateContentHeading.js +++ b/src/content/dependencies/generateContentHeading.js @@ -16,26 +16,24 @@ export default { tag: {type: 'string', default: 'p'}, }, - generate(relations, slots, {html}) { - return html.tag(slots.tag, - { - class: 'content-heading', - id: slots.id, - tabindex: '0', - - style: - slots.color && - relations.colorVariables - .slot('color', slots.color) - .content, - }, [ - html.tag('span', - {[html.onlyIfContent]: true, class: 'content-heading-main-title'}, + generate: (relations, slots, {html}) => + html.tag(slots.tag, {class: 'content-heading'}, + {id: slots.id}, + {tabindex: '0'}, + + slots.color && + {style: + relations.colorVariables + .slot('color', slots.color) + .content}, + + [ + html.tag('span', {class: 'content-heading-main-title'}, + {[html.onlyIfContent]: true}, slots.title), - html.tag('span', - {[html.onlyIfContent]: true, class: 'content-heading-accent'}, + html.tag('span', {class: 'content-heading-accent'}, + {[html.onlyIfContent]: true}, slots.accent), - ]); - } + ]), } -- cgit 1.3.0-6-gf8a5