« get me outta code hell

content: misc content syntax cleanup, mostly attribute merging - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generateContentHeading.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-12-29 22:59:20 -0400
committer(quasar) nebula <qznebula@protonmail.com>2023-12-30 16:26:36 -0400
commitf400a43640e7106d181d55365a9617c3d12e5891 (patch)
tree91c7911c2f5e91d4a230f807814930761991d23a /src/content/dependencies/generateContentHeading.js
parent25c434a514152fdd02e5405e4de418cd62614c6a (diff)
content: misc content syntax cleanup, mostly attribute merging
Diffstat (limited to 'src/content/dependencies/generateContentHeading.js')
-rw-r--r--src/content/dependencies/generateContentHeading.js36
1 files changed, 17 insertions, 19 deletions
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),
-      ]);
-  }
+      ]),
 }