Skip to content

Commit

Permalink
Change casing of window variable on dark-mode page (#1773)
Browse files Browse the repository at this point in the history
Renamed `Window.matchMedia()` to `window.matchMedia()` to give clarity that instance method is being referred and also analogous with the given example below.
  • Loading branch information
arung-agamani authored Jan 31, 2024
1 parent ef864e7 commit 9b046d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pages/docs/dark-mode.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ How you add the `dark` class to the `html` element is up to you, but a common ap

### Supporting system preference and manual selection

The `class` strategy can be used to support both the user's system preference _or_ a manually selected mode by using the [`Window.matchMedia()` API](https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia).
The `class` strategy can be used to support both the user's system preference _or_ a manually selected mode by using the [`window.matchMedia()` API](https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia).

Here's a simple example of how you can support light mode, dark mode, as well as respecting the operating system preference:

Expand Down

0 comments on commit 9b046d8

Please sign in to comment.