⚠️ The content of the docs have not yet been updated for the current version of svu.
https:// svu / store / mediaquery

Mediaquery

A store that syncs to media query changes. Add in a media + value pair or a single 'media' value. Uses window.matchMedia under the hood.

There are many predefined queries available from svu/client.

<script>
    import { mediaquery } from 'svu/store';
    let darkMode = mediaquery('prefers-color-scheme', 'dark');
</script>

{#if darkMode}
    I see a window and I want to paint it black.
{/if}