1 | <script> |
2 | import Highlight, { LineNumbers } from "svelte-highlight"; |
3 | import typescript from "svelte-highlight/languages/typescript"; |
4 | import ashes from "svelte-highlight/styles/ashes"; |
5 |
|
6 | const code = "const add = (a: number, b: number) => a + b"; |
7 | </script> |
8 |
|
9 | <svelte:head> |
10 | {@html ashes} |
11 | </svelte:head> |
12 |
|
13 | <Highlight language={typescript} {code} let:highlighted> |
14 | <LineNumbers |
15 | {highlighted} |
16 | highlightedLines={[16]} |
17 | --highlighted-background="rgba(150, 203, 254, 0.2)" |
18 | /> |
19 | </Highlight> |