I have created a function isColor
that relies on CSS.supports
to determine whether some text is an HTML color or not. This works perfect for color names like red
and hex colors like #3883fa
. However, for the text field
, the function CSS.supports('color', 'field')
returns true
too. The name field
is not mentioned in the list with CSS color names, and I would expect CSS.supports
to return false
in this case.
Why is this the case? Are there other cases like this?
It's a system color meaning the background color of an input field, as defined at Field in the latest draft of CSS Color Module Level 4.