« get me outta code hell

content: generateColorStyleAttribute - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generateWikiHomeContentRow.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-12-29 23:58:38 -0400
committer(quasar) nebula <qznebula@protonmail.com>2023-12-30 16:26:36 -0400
commit3fb01a3022a3f47c0e1e6e76771a35fce23a128b (patch)
treec8b23f194b1c632b02c926cb1b3eeb0b1084cca7 /src/content/dependencies/generateWikiHomeContentRow.js
parentf400a43640e7106d181d55365a9617c3d12e5891 (diff)
content: generateColorStyleAttribute
Diffstat (limited to 'src/content/dependencies/generateWikiHomeContentRow.js')
-rw-r--r--src/content/dependencies/generateWikiHomeContentRow.js25
1 files changed, 8 insertions, 17 deletions
diff --git a/src/content/dependencies/generateWikiHomeContentRow.js b/src/content/dependencies/generateWikiHomeContentRow.js
index c8354fea..8bc54e15 100644
--- a/src/content/dependencies/generateWikiHomeContentRow.js
+++ b/src/content/dependencies/generateWikiHomeContentRow.js
@@ -1,20 +1,14 @@
 export default {
-  contentDependencies: ['generateColorStyleVariables'],
+  contentDependencies: ['generateColorStyleAttribute'],
   extraDependencies: ['html'],
 
-  relations(relation) {
-    return {
-      colorVariables:
-        relation('generateColorStyleVariables'),
-    };
-  },
+  relations: (relation, row) => ({
+    colorStyle:
+      relation('generateColorStyleAttribute', row.color),
+  }),
 
-  data(row) {
-    return {
-      name: row.name,
-      color: row.color,
-    };
-  },
+  data: (row) =>
+    ({name: row.name}),
 
   slots: {
     content: {type: 'html'},
@@ -22,10 +16,7 @@ export default {
 
   generate: (data, relations, slots, {html}) =>
     html.tag('section', {class: 'row'},
-      {style:
-        relations.colorVariables
-          .slot('color', data.color)
-          .content},
+      relations.colorStyle,
 
       [
         html.tag('h2', data.name),