There are various strategies for applying “darkmode” css to an app. It could be hardcoded or it could be based on the user’s “system” preference or it could be toggled via JavaScript.
There are many posts online about how to detect the browser/system preference but how can we know if darkmode is actually currently active (regardless the preference)?
I don’t see anything in the DOM, classname or otherwise called “dark” which we could query.
One way to detect if dark mode is actually active is to monitor the matchMedia API. However, to check if an element is rendered in dark mode regardless of preference, you might need to look at computed styles for specific elements.