You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+25Lines changed: 25 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8735,6 +8735,31 @@ The execution context is created when a function is called. The function's code
8735
8735
8736
8736
**[⬆ Back to Top](#table-of-contents)**
8737
8737
8738
+
464. ### How to detect system dark mode in javascript?
8739
+
8740
+
The combination of `Window.matchMedia()` utility method along with media query is used to check if the user has selected a dark color scheme in their operating system settings or not. The CSS media query `prefers-color-scheme` needs to be passed to identify system color theme.
8741
+
8742
+
The following javascript code describes the usage,
0 commit comments