DEV Community 👩‍💻👨‍💻

Discussion on: Did you know there are 4 and 8 digit hex codes (#11223344?) for colours? 🤯

iainsimmons profile image
Iain Simmons

This feels like a "just because you can, doesn't mean you should" kind of things.

hsla or rgba would both surely be a better choice?

grahamthedev profile image
GrahamTheDev Author • Edited on

Yeah but there are a few little hacks you can do with this (transparent scroll bar thumb on hover, works with hex! Not found a use case for that yet though lol!).

Plus if you are hex everywhere why not keep it consistent so you can easily check one colour is a opacity variant of another.

With all that being said HSLA would be my preference! 💪