preferredColorScheme

Readable prefers-color-scheme media query.

Demo

Preferred Color Scheme: no-preference

Usage

<script lang="ts">
import { preferredColorScheme } from "svelte-legos";

const colorScheme = preferredColorScheme();

// $colorScheme => 'light' | 'dark' | 'no-preference'
</script>