Re: fill and stroke properties with CSS <image> values

Hi!

2014/1/23 Erik Dahlström <ed@opera.com>

> I'm wondering how much of a need there really is to have the fallback
> color in the first place, maybe this is something we should revisit?
>

Let's imagine the following use case:

   1. You have an SVG image with a white background
   2. I have a rect fill with a dark image (fill: url("stuff.png"))
   3. I write some text on top of the rect which color is white
   4. If for some reason the image is not loading, the text become not
   visible (white text on a white background)

Having a fallback color (let's say black) is a safety for such cases.

Another case is if you want to have an image that fade to a colored
background. In such case, it's better to fill with an image as small as
possible and fill the blank with the appropriate color instead of having a
large image mostly full of a plain color. This is more efficient in term of
network performance (we load a smaller resource) and rendering performance
(the color can be paint immediately, even if the image take some time to
load).

Best,
-- 
Jeremie
.............................
Web : http://jeremie.patonnier.net
Twitter : @JeremiePat <http://twitter.com/JeremiePat>

Received on Thursday, 23 January 2014 10:46:11 UTC