An open API service indexing awesome lists of open source software.

https://github.com/captaincodeman/sveltekit-dark-mode

Dark mode toggle using SvelteKit and TailwindCSS
https://github.com/captaincodeman/sveltekit-dark-mode

Last synced: 7 months ago
JSON representation

Dark mode toggle using SvelteKit and TailwindCSS

Awesome Lists containing this project

README

          

NOTE: See [svelte-theme-select](https://github.com/CaptainCodeman/svelte-theme-select) for a better, more complete package

# sveltekit-dark-mode

Simple example showing dark mode theme toggle using SvelteKit + TailwindCSS

- Self contained in a single component
- Includes a simple icon toggle plus an animated switch toggle
- Overrides system setting, once back to current system setting override is removed
- Will dynamically switch based on system preferences

Tip: Use the "Emulate CSS media feature prefers-color-scheme" in the "Rendering" tab of dev-tools to test different browser settings while testing without updating your Operating System config.

## Screenshots

Dark Mode

![dark mode](https://github.com/CaptainCodeman/sveltekit-dark-mode/blob/master/static/dark.png?raw=true)

Light Mode

![light mode](https://github.com/CaptainCodeman/sveltekit-dark-mode/blob/master/static/light.png?raw=true)