Skip to content

Instantly share code, notes, and snippets.

View KarmaBlackshaw's full-sized avatar
🎃
Haunting

Ernie Jeash Villahermosa KarmaBlackshaw

🎃
Haunting
View GitHub Profile
@KarmaBlackshaw
KarmaBlackshaw / readme.md
Created May 5, 2022 10:26 — forked from loilo/readme.md
Sass Dark/Light Theme Mixin

Sass Dark/Light Theme Mixin

This is a Sass mixin to handle a 3-way dark mode. It relies on a data-theme attribute on your <html> element with a value of light or dark. If data-theme is absent (i.e. it's neither light nor dark), the system's preferred mode is used.

body {
  // matches data-theme="light" or data-theme="auto" with system instructing light mode
  @include light {
    background: white;
    color: black;

FWIW: I didn't produce the content presented here (the outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?