Re: [css-images] Syntax for image() incorrect?

On Thu, Mar 3, 2016 at 5:37 AM, Sebastian Zartner
<sebastianzartner@gmail.com> wrote:
> The description for the image() function says that it allows to use a
> solid color as an image.
>
> Though its syntax is defined as
>
>     image( [ [ <image> | <string> ]? , <color>? ]! )
>
> meaning that colors are only allowed as fallback values.

How are you getting this?  The syntax marks both parts as optional,
and just requires that you specify one of them.  So image(blue) is
valid per that grammar.

> Furthermore, the syntax for the image() function suggests that the
> comma stands for its own and is not influenced by the question mark
> multiplier after <color>.

Correct, but https://drafts.csswg.org/css-values/#comb-comma clarifies
how commas work in CSS grammars - they're automatically required to be
omitted unless they're actually separating things.

~TJ

Received on Thursday, 3 March 2016 19:58:44 UTC