svelte-tailwind-starter

Svelte Tailwind Starter

project template for svelte-tailwind-starter

Intro

a scaffolding project for svelte and tailwindcss + daisyui

How to use

cp -Rv {current folder} {target folder}
cd {target folder}
sh reset.sh

to add theme change

默认使用daisyui的luxury主题:

<html lang="en" data-theme="luxury">
...

如果想允许用户可以切换不同的theme, 可以考虑使用theme-change

<script>
    import { themeChange } from 'theme-change'
    ...
    onMount(async () => {
        themeChange(false)
        ...
    })
</script>

<select id="theme-select" data-choose-theme class="select">
    <option value="Business">Default</option>
    <option value="dark">Dark</option>
    <option value="dracula">Dracula</option>
    <option value="luxury">luxury</option>
    <option value="Coffee">Coffee</option>
</select>

data-choose-theme is the key!

DaisyUI

https://daisyui.com/components/

Top categories

Loading Svelte Themes