Re: [css3-background] A property to control background opacity

On Tue, Dec 24, 2013 at 11:56 AM, Simon Fraser <smfr@me.com> wrote:

> Of course!
>
> Given this, I see little utility in a per-background-image
> background-opacity property.
>

It's not so much utility as ease of use.
CSS filters could have been implemented as parameterized SVG filters but we
chose to have shorthands since they're easier to use.

If a lot of developers *just* want to control opacity of the backdrop, it's
reasonable to have that as its own property.
I guess this would be a negotiation between browser vendors who prefer
fewer properties vs developers who like more ;-)


>
> The only utility for a new background-opacity property that I can see is
> one that is not per-background-image, but rather applies opacity to the
> grouped background images and background color,
>

That would be nice to have as well. Maybe we can extend 'opacity' so you
can name the part of the element you're applying it to? ie:

opacity: background .5;




> On Dec 23, 2013, at 11:57 pm, Dirk Schulze <dschulze@adobe.com> wrote:
>
>
> On Dec 24, 2013, at 8:47 AM, Dirk Schulze <dschulze@adobe.com> wrote:
>
>
> On Dec 24, 2013, at 8:34 AM, Simon Fraser <smfr@me.com> wrote:
>
> On Dec 23, 2013, at 7:06 PM, Rik Cabanier <cabanier@gmail.com> wrote:
>
> On Mon, Dec 23, 2013 at 4:33 PM, David <david.email@ymail.com> wrote:
> Hello,
>
> it would be great if a CSS property would be added to control the opacity
> of the background-image.
> The background-color and its opacity is already controlable via rgba() or
> hsla().
> The opacity property itself allows just to control the opacity of the
> whole element.
>
> We had a short discussion on this at the last F2F during TPAC [1].
> It was unfortunately not minuted. :-(
>
> During the meeting, people said that this feature has been requested for a
> long time but for some reason, it never was spec'ed out or implemented.
>
> Normative text could look as follows:
> The ‘background-opacity’ property
>
> An alternative to this would be to have an image function that gives an
> image alpha, e.g.:
>
> background-image: alpha-image(foo.png, 50%);
>
> This would seem preferable to a property that can only apply alpha to
> background images.
>
>
> Just to give more alternatives: In WebKit the CSS Image function
> -webkit-filter() is implemented with the opacity filter function:
>
> background-image: -webkit-filter(foo.png, opacity(0.5));
>
>
> Just to give a bit more background: The filter() image function is
> specified in Filter Effects[1] and allows filtering other CSS Images:
>
> filter( [ <image> | <string> ], <filter-function-list> )
>
> opacity() is one of the filter functions beside others [2].
>
> Greetings,
> Dirk
>
> [1] http://dev.w3.org/fxtf/filters/#FilterCSSImageValue
> [2] http://dev.w3.org/fxtf/filters/#FilterProperty
>
>
> Greetings,
> Dirk
>
>
> Simon
>
>
>

Received on Thursday, 26 December 2013 03:08:47 UTC