check system theme in javascript code example
Example: javascript detect dark mode
const isDarkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
const isDarkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;