DEV Community

Marius Eisenbraun
Marius Eisenbraun

Posted on

TIL: In CSS, DarkGray is lighter than Gray

When building prototypes or examples, I often use named CSS colors.

After playing around and working with CSS for some years, today I learnt:

DarkGray is lighter than Gray 🤔

It got me so confused, I had to check it three times.

The easy solution:
If you want a "dark gray", choose DimGray.☝️

Top comments (4)

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt

Codepen? please.

Collapse
 
gillmangareth profile image
Gareth Gillman

codepen.io/garethTF/pen/gObeVYY

Seems wierd but it's true... CSS is confusing at times.

Collapse
 
mr_eis profile image
Marius Eisenbraun

Oh someone was faster than me :D

Thanks, for the CodePen!

Collapse
 
johnnykoo84 profile image
Johnny Ilmo Koo

never knew about it until I see this post Thanks

Some comments may only be visible to logged-in visitors. Sign in to view all comments.