Saltar al contenido principal

Function: useMatchesMedia()

useMatchesMedia(query): boolean

Defined in: src/infrastructure/viewport/viewport.service.ts:56

Tests a CSS media query against the current viewport.

Parameters

query

string

A CSS media query string (e.g. "(min-width: 768px)").

Returns

boolean

true if the query matches.

Example

if (useMatchesMedia("(prefers-reduced-motion: reduce)")) {
// disable animations
}