use_preferred_contrast
Reactive prefers-contrast media query.
Usage
use leptos::prelude::*;
use leptos_use_preferences::use_preferred_contrast;
#[component]
fn Demo() -> impl IntoView {
let preferred_contrast = use_preferred_contrast();
view! { }
}
Server-Side Rendering
Make sure you follow the instructions in Server-Side Rendering.
On the server this returns a Signal that always contains the value PreferredContrast::NoPreference.
See also
Installation
cargo add leptos-use-preferences