diff options
Diffstat (limited to 'src/content')
-rw-r--r-- | src/content/dependencies/generateTooltip.js | 30 |
1 files changed, 30 insertions, 0 deletions
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)), +}; |