Leptos-Use Guide

use_preferred_contrast

Reactive prefers-contrast media query.

Usage

use leptos::*;
use leptos_use::use_preferred_contrast;

#[component]
fn Demo() -> impl IntoView {

let preferred_contrast = use_preferred_contrast();

   view! { }
}

Server-Side Rendering

On the server this returns a Signal that always contains the value PreferredContrast::NoPreference.

See also

Types

Source

SourceDocs