From 11dc3d3ef903b6ad5259d081c57b1c91c4616665 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sat, 13 Jan 2024 15:36:05 -0400 Subject: content: generateTooltip --- src/content/dependencies/generateTooltip.js | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/content/dependencies/generateTooltip.js diff --git a/src/content/dependencies/generateTooltip.js b/src/content/dependencies/generateTooltip.js new file mode 100644 index 00000000..81f74aec --- /dev/null +++ b/src/content/dependencies/generateTooltip.js @@ -0,0 +1,30 @@ +export default { + extraDependencies: ['html'], + + slots: { + attributes: { + type: 'attributes', + mutable: false, + }, + + contentAttributes: { + type: 'attributes', + mutable: false, + }, + + content: { + type: 'html', + mutable: false, + }, + }, + + generate: (slots, {html}) => + html.tag('span', {class: 'tooltip'}, + {[html.noEdgeWhitespace]: true}, + slots.attributes, + + html.tag('span', {class: 'tooltip-content'}, + {[html.noEdgeWhitespace]: true}, + slots.contentAttributes, + slots.content)), +}; -- cgit 1.3.0-6-gf8a5