CSS is awesome: A dark/light mode switch with preference detection in 15 lines of CSS

I just love how far CSS has come in the last few years. With custom properties and media queries you can achieve so much in just a few lines of code. For example, these 15 lines make sure that users of light mode in their operating systems get a black …


This content originally appeared on Christian Heilmann and was authored by Chris Heilmann

I just love how far CSS has come in the last few years. With custom properties and media queries you can achieve so much in just a few lines of code. For example, these 15 lines make sure that users of light mode in their operating systems get a black on white document and those […]


This content originally appeared on Christian Heilmann and was authored by Chris Heilmann


Print Share Comment Cite Upload Translate
APA
Chris Heilmann | Sciencx (2022-12-08T05:19:54+00:00) » CSS is awesome: A dark/light mode switch with preference detection in 15 lines of CSS. Retrieved from https://www.scien.cx/2021/01/26/css-is-awesome-a-dark-light-mode-switch-with-preference-detection-in-15-lines-of-css/.
MLA
" » CSS is awesome: A dark/light mode switch with preference detection in 15 lines of CSS." Chris Heilmann | Sciencx - Tuesday January 26, 2021, https://www.scien.cx/2021/01/26/css-is-awesome-a-dark-light-mode-switch-with-preference-detection-in-15-lines-of-css/
HARVARD
Chris Heilmann | Sciencx Tuesday January 26, 2021 » CSS is awesome: A dark/light mode switch with preference detection in 15 lines of CSS., viewed 2022-12-08T05:19:54+00:00,<https://www.scien.cx/2021/01/26/css-is-awesome-a-dark-light-mode-switch-with-preference-detection-in-15-lines-of-css/>
VANCOUVER
Chris Heilmann | Sciencx - » CSS is awesome: A dark/light mode switch with preference detection in 15 lines of CSS. [Internet]. [Accessed 2022-12-08T05:19:54+00:00]. Available from: https://www.scien.cx/2021/01/26/css-is-awesome-a-dark-light-mode-switch-with-preference-detection-in-15-lines-of-css/
CHICAGO
" » CSS is awesome: A dark/light mode switch with preference detection in 15 lines of CSS." Chris Heilmann | Sciencx - Accessed 2022-12-08T05:19:54+00:00. https://www.scien.cx/2021/01/26/css-is-awesome-a-dark-light-mode-switch-with-preference-detection-in-15-lines-of-css/
IEEE
" » CSS is awesome: A dark/light mode switch with preference detection in 15 lines of CSS." Chris Heilmann | Sciencx [Online]. Available: https://www.scien.cx/2021/01/26/css-is-awesome-a-dark-light-mode-switch-with-preference-detection-in-15-lines-of-css/. [Accessed: 2022-12-08T05:19:54+00:00]
rf:citation
» CSS is awesome: A dark/light mode switch with preference detection in 15 lines of CSS | Chris Heilmann | Sciencx | https://www.scien.cx/2021/01/26/css-is-awesome-a-dark-light-mode-switch-with-preference-detection-in-15-lines-of-css/ | 2022-12-08T05:19:54+00:00
https://github.com/addpipe/simple-recorderjs-demo