Skip to content

Commit

Permalink
Update files/en-us/web/api/window/matchmedia/index.md
Browse files Browse the repository at this point in the history
Co-authored-by: wbamberg <[email protected]>
  • Loading branch information
chriskirknielsen and wbamberg authored Jan 23, 2025
1 parent cae99e1 commit a5a70fd
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions files/en-us/web/api/window/matchmedia/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ matchMedia(mediaQueryString)
- `mediaQueryString`
- : A string specifying the media query to parse into a {{domxref("MediaQueryList")}}.

> [!NOTE]
> Just like in CSS, any [media feature](/en-US/docs/Web/CSS/@media#media_features) must be wrapped in parentheses inside the expression. For example: `matchMedia('(max-width: 600px)')` will work, whereas `matchMedia('max-width: 600px')` will not. Keywords for media types (`all`, `print`, `screen`) and logical operators (`and`, `or`, `not`, `only`) do not need to be wrapped in parentheses.
Just like in CSS, any [media feature](/en-US/docs/Web/CSS/@media#media_features) must be wrapped in parentheses inside the expression. For example: `matchMedia('(max-width: 600px)')` will work, whereas `matchMedia('max-width: 600px')` will not. Keywords for media types (`all`, `print`, `screen`) and logical operators (`and`, `or`, `not`, `only`) do not need to be wrapped in parentheses.
### Return value

A new {{domxref("MediaQueryList")}} object for the media query. Use this object's
Expand Down

0 comments on commit a5a70fd

Please sign in to comment.