Files
nodarium/packages/ui/src/lib/Details.svelte
Max Richter b19da950a6 refactor: use tailwind custom colors for themes
Use tailwind v4 @theme block so we can use bg-layer-0 instead of
bg-[--layer-0] for theme colors.
2026-02-03 12:18:44 +01:00

35 lines
729 B
Svelte

<script lang="ts">
import type { Snippet } from 'svelte';
interface Props {
title?: string;
transparent?: boolean;
children?: Snippet;
open?: boolean;
}
let { title = 'Details', transparent = false, children, open = $bindable(false) }: Props =
$props();
</script>
<details class:transparent bind:open class="text-text outline-1 outline-outline bg-layer-1">
<summary>{title}</summary>
<div class="content">
{@render children?.()}
</div>
</details>
<style>
details {
padding: 1em;
padding-left: 20px;
border-radius: 2px;
font-weight: 300;
font-size: 0.9em;
}
details.transparent {
background-color: transparent;
padding: 0;
outline: none;
}
</style>