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.
This commit is contained in:
Hector Candelaria 2024-08-18 17:19:50 -04:00
parent 6d57bdf7f5
commit f5a37f6c7f
3 changed files with 4 additions and 1 deletions

View file

@ -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<MaybeSignal<String>>) -> Signal<bool> {
let query = query.into();

View file

@ -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<PreferredContrast> {
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 {

View file

@ -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<bool> {
use_preferred_dark_with_options(Default::default())
}