Re: Proposal: background-image-opacity or background-opacity

On Tue, Jun 2, 2009 at 6:59 PM, Giovanni Campagna
<scampa.giovanni@gmail.com> wrote:
> 2009/6/2 Tab Atkins Jr. <jackalmage@gmail.com>:
>> On Tue, Jun 2, 2009 at 11:38 AM, Brad Kemper <brad.kemper@gmail.com> wrote:
>>>
>>> On Jun 2, 2009, at 9:21 AM, Boris Zbarsky wrote:
>>>
>>>> Mark wrote:
>>>>>
>>>>> Now with the css 3 backgrounds module multiple backgrounds are going
>>>>> to be supported. Webkit has support for it and Gecko is in the
>>>>> progress of making it all work. Now with that module (once adapted by
>>>>> the biggest rendering engines) you can give one element both his
>>>>> normal image and his hover image which is exactly the way it should be
>>>>> if you ask me. Now i see one issue comming there. If you want to fade
>>>>> from the normal image to the hover image you currently (if i read the
>>>>> spec right) can't do that because there is no way of letting either
>>>>> one of those images disappear, no way to set the opacity per image.
>>>>
>>>> Seems like this could be dealt with by just having separate style rules
>>>> setting the two images and defining CSS transitions on background image to
>>>> do fade in/out, maybe....
>
> How would you do that? Do you mean to fade out completely the previous
> image, then fade in the new?
> I don't think this is what the original poster intended.
>
I don't exactly know what the css transitions draft (?) is capable of
but it doen't sound like the thing i meant.
Fading out one image right now is possible! only then you need to fade
out the entire div which required you to make 1 container div and a x
number of state divs (one for hover one for normal etcetera.) What i
intended was just the ability to set the opacity of one of the
background images (or all).. and the added bunos of that ability is
that a fade transition becomes possible without putting in multiple
elements to cross fade.

>>>
>>>> -Boris
>>>>
>>>
>>> Yes, I think that fade transitions would be good for a few other properties
>>> too (those that don't change layout), such as visibility, border-style
>>> (except for 'none'), content, list-style-image, border-image, etc.
>>
>> Basically transitioning any image can be done with a fade like that.
>>
>> Ooh, the thought of transitioning border-style is interesting.
>>
>> ~TJ
>>
>>
>
> If any image can be faded, it seems that "fading level" (opacity) is a
> property of the image and therefore should be specified along with the
> image.
> I mean something like faded-img(<uri>,<number>), to be used in
> background-image, border-image, list-style-image, etc.
> It is slightly more verbose when you deal with transitions (since you
> repeat every time the <uri>), but avoids adding new properties (and
> potentially new values for the shorthand)

True but is it needed to provide that uri again?
i mean it's already known in background-image..
doing the background-opacity transition like in my first post seems
more logical to me.
>
> More powerful would be to apply any SVG filter to the image, not just
> opacity, for example to animate from black and white to colour, but I
> don't know if it is needed.
>
> Giovanni
>
I don't have a lot of svg experience. No idea if this would be good or bad.

What's basicly needed is some way to set the opacity of one of the set
backgrounds in background-image (what i proposed in my first post).

Received on Tuesday, 2 June 2009 17:13:31 UTC