From 9b046d884359ec65d32a7da2715479da28c6751e Mon Sep 17 00:00:00 2001 From: arung-agamani <35528733+arung-agamani@users.noreply.github.com> Date: Wed, 31 Jan 2024 23:02:06 +0800 Subject: [PATCH] Change casing of `window` variable on dark-mode page (#1773) Renamed `Window.matchMedia()` to `window.matchMedia()` to give clarity that instance method is being referred and also analogous with the given example below. --- src/pages/docs/dark-mode.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/docs/dark-mode.mdx b/src/pages/docs/dark-mode.mdx index 74f9d01e8..f76a1f4a0 100644 --- a/src/pages/docs/dark-mode.mdx +++ b/src/pages/docs/dark-mode.mdx @@ -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: