DEV Community

Discussion on: Dark Mode - Unmistified! 🐱‍👤

Collapse
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️ • Edited
<body dark>

body {
   --lightness: .8;
}
body[dark] {
   --lightness: .2;
}
p {
   color: hsla(200, 60%, calc(1 - var(--lightness)));
   /* etc. */
}

🤷

Collapse
 
akhilarjun profile image
Akhil Arjun

Only if more people would use and understand hsla 😍😍

Collapse
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

I know right? It's the easiest way to write colours, yet everybody still uses hex-codes for some reason... Worst part about it is, many people apparently can't even read/write hex codes and just copy-paste them around.

Thread Thread
 
tateronaut profile image
tate shepherd

I don't understand hsla, and am definitely guilty of copy pasting hex codes. You've inspired me to check it out! I'd love a more logical way of doing colors than hex codes

Thread Thread
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

Nice! I sure hope it makes your life easier :D