Check out example codes for "css darkmode". It will help you in understanding the concepts better.

Code Example 1

@media (prefers-color-scheme: dark) {

}

Code Example 2

body {
  background-color: black;
  color: white;
}

@media screen and (prefers-color-scheme: light) {
  body {
    background-color: white;
    color: black;
  }
}

Learn ReactJs, React Native from akashmittal.com