W3C home > Mailing lists > Public > www-style@w3.org > February 2015

Re: [css-backgrounds] Add opacity to <bg-layer> definition

From: Axel Dahmen <brille1@hotmail.com>
Date: Thu, 5 Feb 2015 15:29:16 +0100
To: www-style@w3.org
Message-ID: <mavur3$co$1@ger.gmane.org>
"Tab Atkins Jr."  schrieb im Newsbeitrag 
> On Sun, Feb 1, 2015 at 6:44 PM, Axel Dahmen <brille1@hotmail.com> wrote:
> > Can't use cross_fade() for this purpose, because you cannot apply 
> > background
> > attributes, like repeat, to cross_fade() images each.
> That's correct, but a non-sequitur.  I was suggesting cross-fade()
> because it lets you create faded-out images.  (I think the
> Webkit/Blink impl doesn't match the current spec, so it's a little
> harder than it should be to do this; I think you have to manually
> provide a transparent image, such as with a super simple data: url).
> You can then use that faded-out image in background-image as normal.

I apprehend, but wouldn't the opacity parameter be a reasonable addition to 
the <bg-layer> specification, though?

(I made a mistake in my previous examples by providing the hypothetic 
opacity parameter as a percent value. It's, of course, supposed to be a 
fractional value.)

> I suspect you thought I meant using cross-fade() to fade between the
> two layer images?  If they're the same size/position/etc, you can do
> that and it's nice and easy (and you don't even *need* to use
> cross-fade() manually; the impls that support it will automatically
> use it when you just do an animation/transition between two images).
> If they're not the same, then no, that won't work; you need to fade
> each image separately with individual cross-fade()s.

I don't quite apprehend. How would one add a semi-transparent watermark/logo 
image with a full background image by using cross-fade()?

> > Moreover, I'm missing a transition definition for cross_fade(). From the
> > spec I understand that cross_fade() is only be used *within* a 
> > transaction.
> No.  You can use cross-fade() wherever you want; it's just a type of
> <image>, and is usable anywhere that <image>s are.  What part of the
> spec suggests that it can only be used within a transition?

It's "2.4. Combining images: the cross-fade() notation"

"When transitioning between images, CSS requires a way to explicitly refer 
to the intermediate image that is a combination of the start and end images. 
This is accomplished with the cross-fade() function"

Received on Thursday, 5 February 2015 14:31:39 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:51 UTC