Link: Using Dark Mode in CSS

Thomas Mak wrote at 2018-11-01.

#css #link #resources

https://paulmillr.com/posts/using-dark-mode-in-css/

/* Text and background color for light mode */
body {
  color: #333;
}

/* Text and background color for dark mode */
@media (prefers-color-scheme: dark) {
  body {
    color: #ddd;
    background-color: #222;
  }
}

Example code from Paul Miller.

Comments

no comments yet.