Darkmode

Setup

// tailwind.config.cjs const config = { darkMode: 'class' // ... };

// src/app.html

<body class="bg-white dark:bg-gray-800">
  <div>%svelte.body%</div>
</body>

Initial theme

Add the following to `app.html`:
<html class="dark" lang="en">

Examples

<script>
  import { Darkmode } from 'svelte-5-ui-lib';
</script>

<Darkmode />

Component data