From f5a37f6c7f239fad9e46032ab1f7140bc7ba978c Mon Sep 17 00:00:00 2001 From: Hector Candelaria Date: Sun, 18 Aug 2024 17:19:50 -0400 Subject: [PATCH] Docs: Update See also references in media query functions - Added `use_prefers_reduced_motion` in the documentation for `use_media_query`, `use_preferred_contrast`, and `use_preferred_dark` functions to include links to related functions. --- src/use_media_query.rs | 1 + src/use_preferred_contrast.rs | 3 ++- src/use_preferred_dark.rs | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/use_media_query.rs b/src/use_media_query.rs index 61e423c..a97a00c 100644 --- a/src/use_media_query.rs +++ b/src/use_media_query.rs @@ -38,6 +38,7 @@ use std::rc::Rc; /// /// * [`fn@crate::use_preferred_dark`] /// * [`fn@crate::use_preferred_contrast`] +/// * [`fn@crate::use_prefers_reduced_motion`] pub fn use_media_query(query: impl Into>) -> Signal { let query = query.into(); diff --git a/src/use_preferred_contrast.rs b/src/use_preferred_contrast.rs index 85fc679..d90998f 100644 --- a/src/use_preferred_contrast.rs +++ b/src/use_preferred_contrast.rs @@ -27,6 +27,7 @@ use std::fmt::Display; /// /// * [`fn@crate::use_media_query`] /// * [`fn@crate::use_preferred_dark`] +/// * [`fn@crate::use_prefers_reduced_motion`] pub fn use_preferred_contrast() -> Signal { let is_more = use_media_query("(prefers-contrast: more)"); let is_less = use_media_query("(prefers-contrast: less)"); @@ -53,8 +54,8 @@ pub enum PreferredContrast { Custom, #[default] NoPreference, -} +} impl Display for PreferredContrast { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { diff --git a/src/use_preferred_dark.rs b/src/use_preferred_dark.rs index ad64f13..c397f82 100644 --- a/src/use_preferred_dark.rs +++ b/src/use_preferred_dark.rs @@ -41,6 +41,7 @@ use std::rc::Rc; /// /// * [`fn@crate::use_media_query`] /// * [`fn@crate::use_preferred_contrast`] +/// * [`fn@crate::use_prefers_reduced_motion`] pub fn use_preferred_dark() -> Signal { use_preferred_dark_with_options(Default::default()) }