Term
A word of the vocabulary in the middle of a sentence: hover or focus it and its definition shows; press it and you go to the glossary.
import Term from '@sypnia/ui/astro/Term.astro'
On this page
Two words
Wrap the article (or the page) in Terms once.
Every problem has a trace: open it to see where the time went.
Code
---
// Hover or focus the dotted words.
import Terms from '@sypnia/ui/astro/Terms.astro';
import Term from '@sypnia/ui/astro/Term.astro';
---
<Terms>
<p class="sy-text" style="max-width:38rem">Every <Term term="problem" definition="A group of errors with the same cause, counted once however often it happens." href="#glossary-problem">problem</Term> has a <Term term="trace" definition="The path one request took through your services, step by step.">trace</Term>: open it to see where the time went.</p>
</Terms> When to use it
Use it when
- The first time a word of the product's vocabulary appears on a page.
Do not use it when
- Every time the word appears: once per page is enough.
For everyone
- The definition shows on keyboard focus too, and is linked as its description.
- Escape hides it.