W3C home > Mailing lists > Public > www-style@w3.org > March 2016

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

From: Sebastian Zartner <sebastianzartner@gmail.com>
Date: Thu, 3 Mar 2016 14:37:37 +0100
Message-ID: <CAERejNZ8Rtv472u42hYUY5wiBDTueSOJ77Xp5xCdL5YaVB_2dg@mail.gmail.com>
To: www-style list <www-style@w3.org>
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. So, in order
to allow solid-color images, either the syntax needs to be changed to

    image( [ [ <image> | <color> | <string> ]? , <color>? ]! )

or

    image( [ [ [ <image> | <string> ]? , <color>? ]! | <color> ] )

or <image> may be changed to accept <color> values directly, i.e.

    <url> | <image()> | <image-set()> | <element()> | <cross-fade()> |
<gradient> | <color>

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>. Therefore I wonder whether the correct
syntax would rather be (disregarding the changes suggested above)

    image( [ <image> | <string> ] [ , <color> ]? )

Sebastian
Received on Thursday, 3 March 2016 13:38:24 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:09:01 UTC