DEV Community

Discussion on: Challenge #1

Collapse
 
jonrandy profile image
Jon Randy 🎖️ • Edited

Unfortunately, that doesn't even come close to checking all valid CSS colours - there are many, many, named colours that are completely valid (red, white, green, burlywood, chartreuse, etc.) as well as CSS variables like var(--myColour).

Also, checking if it starts with # really is not enough in the case of hex values.

There's actually a very quick, short way of checking ALL of this... but I won't give it away here just yet

Collapse
 
saifullahusmani profile image
Saifullah Usmani

I thought it is a quick thing. I know it is not 100% correct method. But now I got your point.