refac: styling

This commit is contained in:
Timothy Jaeryang Baek
2025-02-03 00:03:41 -08:00
parent 78853a67e4
commit 58d2fd9ac1
5 changed files with 59 additions and 7 deletions
@@ -23,6 +23,7 @@
export let id: string;
export let tokens: Token[];
export let top = true;
export let attributes = {};
export let save = false;
export let onSourceClick: Function = () => {};
@@ -83,6 +84,7 @@
{token}
lang={token?.lang ?? ''}
code={token?.text ?? ''}
{attributes}
{save}
on:code={(e) => {
dispatch('code', e.detail);
@@ -197,7 +199,11 @@
{:else if token.type === 'details'}
<Collapsible title={token.summary} attributes={token?.attributes} className="w-full space-y-1">
<div class=" mb-1.5" slot="content">
<svelte:self id={`${id}-${tokenIdx}-d`} tokens={marked.lexer(token.text)} />
<svelte:self
id={`${id}-${tokenIdx}-d`}
tokens={marked.lexer(token.text)}
attributes={token?.attributes}
/>
</div>
</Collapsible>
{:else if token.type === 'html'}